[Bug 546035] New: blktrace-1.0.1-3.21: memory leak in useless code
http://bugzilla.novell.com/show_bug.cgi?id=546035 Summary: blktrace-1.0.1-3.21: memory leak in useless code Classification: openSUSE Product: openSUSE 11.2 Version: Factory Platform: All OS/Version: openSUSE 11.1 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de Found By: --- I just had a look at factory package blktrace-1.0.1-3.21 source code file blktrace-1.0.1/btreplay/btreplay.c function find_input_devs local variable is dsf I notice the following code while ((ent = readdir(dir)) != NULL) { char *p, *dsf = malloc(256); if (strstr(ent->d_name, ".replay.") == NULL) continue; dsf = strdup(ent->d_name); so the call to malloc at the declaration of dsf is a memory leak and useless code. Suggest new code while ((ent = readdir(dir)) != NULL) { char *p, *dsf; if (strstr(ent->d_name, ".replay.") == NULL) continue; dsf = strdup(ent->d_name); -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=546035
Andreas Jaeger
http://bugzilla.novell.com/show_bug.cgi?id=546035
User marek.belisko@open-nandra.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=546035#c1
Marek Belisko
http://bugzilla.novell.com/show_bug.cgi?id=546035
User rguenther@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=546035#c2
--- Comment #2 from Richard Guenther
http://bugzilla.novell.com/show_bug.cgi?id=546035
User jack@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=546035#c3
Jan Kara
http://bugzilla.novell.com/show_bug.cgi?id=546035
http://bugzilla.novell.com/show_bug.cgi?id=546035#c4
Jan Blunck
http://bugzilla.novell.com/show_bug.cgi?id=546035
http://bugzilla.novell.com/show_bug.cgi?id=546035#c5
--- Comment #5 from Bernhard Wiedemann
participants (1)
-
bugzilla_noreply@novell.com