Skip to contentSkip to conversation

Remove extraneous malloc in find_input routines

PATCH New Eric Sandeen 1 participant 1 message Dec 16, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 5/10 Remove extraneous malloc in find_input routines

No point in malloc()ing space if we just immediately overwrite the pointer via strdup. That'll leak some space.

---

btreplay/btrecord.c +1 -1
index 88ab806..3646257 100644
@@ -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;
btreplay/btreplay.c +1 -1
index f4f5aa0..20494e0 100644
@@ -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;