mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
disk-label: fix memory leakages
Avoid a strdup() call. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@867 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -64,9 +64,6 @@ dlabel_open( dlabel_info_t *di )
|
|||||||
cell status;
|
cell status;
|
||||||
|
|
||||||
path = my_args_copy();
|
path = my_args_copy();
|
||||||
if (!path) {
|
|
||||||
path = strdup("");
|
|
||||||
}
|
|
||||||
|
|
||||||
DPRINTF("dlabel-open '%s'\n", path );
|
DPRINTF("dlabel-open '%s'\n", path );
|
||||||
|
|
||||||
@@ -122,14 +119,14 @@ dlabel_open( dlabel_info_t *di )
|
|||||||
DPRINTF("Located filesystem with ph " FMT_ucellx "\n", ph);
|
DPRINTF("Located filesystem with ph " FMT_ucellx "\n", ph);
|
||||||
DPRINTF("path: %s length: %d\n", path, strlen(path));
|
DPRINTF("path: %s length: %d\n", path, strlen(path));
|
||||||
|
|
||||||
if (strlen(path)) {
|
if (path && strlen(path)) {
|
||||||
DPRINTF("INTERPOSE!\n");
|
DPRINTF("INTERPOSE!\n");
|
||||||
|
|
||||||
push_str( path );
|
push_str( path );
|
||||||
PUSH_ph( ph );
|
PUSH_ph( ph );
|
||||||
fword("interpose");
|
fword("interpose");
|
||||||
}
|
}
|
||||||
} else if (*path && strcmp(path, "%BOOT") != 0) {
|
} else if (path && strcmp(path, "%BOOT") != 0) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user