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 <[email protected]>
---
 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;
         }
 

_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to