Remove extraneous malloc in find_input routines
authorEric Sandeen <sandeen@redhat.com>
Fri, 16 Dec 2011 19:13:21 +0000 (13:13 -0600)
committerJens Axboe <jaxboe@fusionio.com>
Wed, 1 Feb 2012 12:14:27 +0000 (13:14 +0100)
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>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
btreplay/btrecord.c
btreplay/btreplay.c

index 88ab806d33f898e965c94c480980556f591b68bd..36462579251e18636739d2aa5208109f0551e58f 100644 (file)
@@ -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;
index f4f5aa09c25a6ba951d4855d414ce16b40783cb6..20494e0d31f1814c1ca45d3816ac76b1cd74663a 100644 (file)
@@ -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;