j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: blueswirl Date: Tue Sep 28 20:59:47 2010 New Revision: 867 URL: http://tracker.coreboot.org/trac/openbios/changeset/867
Log: disk-label: fix memory leakages
Avoid a strdup() call.
Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/packages/disk-label.c
Modified: trunk/openbios-devel/packages/disk-label.c ============================================================================== --- trunk/openbios-devel/packages/disk-label.c Tue Sep 28 20:59:45 2010 (r866) +++ trunk/openbios-devel/packages/disk-label.c Tue Sep 28 20:59:47 2010 (r867) @@ -64,9 +64,6 @@ cell status;
path = my_args_copy(); - if (!path) { - path = strdup(""); - }
DPRINTF("dlabel-open '%s'\n", path );
@@ -122,14 +119,14 @@ DPRINTF("Located filesystem with ph " FMT_ucellx "\n", ph); DPRINTF("path: %s length: %d\n", path, strlen(path));
- if (strlen(path)) { + if (path && strlen(path)) { DPRINTF("INTERPOSE!\n");
push_str( path ); PUSH_ph( ph ); fword("interpose"); } - } else if (*path && strcmp(path, "%BOOT") != 0) { + } else if (path && strcmp(path, "%BOOT") != 0) { goto out; }