1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-30 23:21:08 +03:00

efivars: un-leak a few strings

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2013-04-03 16:32:01 -04:00
parent d257f05a5f
commit 5483a18693

View File

@ -231,11 +231,13 @@ int efi_get_boot_option(
if (title_size > l - offsetof(struct boot_option, title))
return -EINVAL;
if (title) {
s = utf16_to_utf8(header->title, title_size);
if (!s) {
err = -ENOMEM;
goto err;
}
}
if (header->path_len > 0) {
uint8_t *dbuf;
@ -270,12 +272,13 @@ int efi_get_boot_option(
if (dpath->drive.signature_type != 0x02)
continue;
if (part_uuid)
efi_guid_to_id128(dpath->drive.signature, &p_uuid);
continue;
}
/* Sub-Type 4 File Path */
if (dpath->sub_type == 0x04) {
if (dpath->sub_type == 0x04 && !p && path) {
p = utf16_to_utf8(dpath->path, dpath->length-4);
continue;
}