[systemd-devel] [PATCH] gummiboot: freeing the wrong variable

David Härdeman david at hardeman.nu
Mon Dec 22 12:44:31 PST 2014


The error path in efivar_get free's what would have been
the copy of the string if the strcpy had succeeded, which
it did not (or we wouldn't be in the error path).

Signed-off-by: David Härdeman <david at hardeman.nu>
---
 src/efi/util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/efi/util.c b/src/efi/util.c
index 4715c57..7cb8e0f 100644
--- a/src/efi/util.c
+++ b/src/efi/util.c
@@ -102,7 +102,7 @@ EFI_STATUS efivar_get(CHAR16 *name, CHAR16 **value) {
 
         val = StrDuplicate((CHAR16 *)buf);
         if (!val) {
-                FreePool(val);
+                FreePool(buf);
                 return EFI_OUT_OF_RESOURCES;
         }
 



More information about the systemd-devel mailing list