* [PATCH 5/10] Remove extraneous malloc in find_input routines
@ 2011-12-16 19:13 Eric Sandeen
0 siblings, 0 replies; only message in thread
From: Eric Sandeen @ 2011-12-16 19:13 UTC (permalink / raw)
To: linux-btrace
No point in malloc()ing space if we just immediately overwrite
the pointer via strdup. That'll leak some space.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/btreplay/btrecord.c b/btreplay/btrecord.c
index 88ab806..3646257 100644
--- a/btreplay/btrecord.c
+++ b/btreplay/btrecord.c
@@ -365,7 +365,7 @@ static void find_input_files(char *idir)
}
while ((ent = readdir(dir)) != NULL) {
- char *p, *dsf = malloc(256);
+ char *p, *dsf;
if (strstr(ent->d_name, ".blktrace.") = NULL)
continue;
diff --git a/btreplay/btreplay.c b/btreplay/btreplay.c
index f4f5aa0..20494e0 100644
--- a/btreplay/btreplay.c
+++ b/btreplay/btreplay.c
@@ -596,7 +596,7 @@ static void find_input_devs(char *idir)
}
while ((ent = readdir(dir)) != NULL) {
- char *p, *dsf = malloc(256);
+ char *p, *dsf;
if (strstr(ent->d_name, ".replay.") = NULL)
continue;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-12-16 19:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-16 19:13 [PATCH 5/10] Remove extraneous malloc in find_input routines Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).