[PATCH 1/5] efi: fix memory leak in error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Lucas Stach <dev@xxxxxxxxxx>
---
 arch/efi/efi/efi-device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/efi/efi/efi-device.c b/arch/efi/efi/efi-device.c
index 7db8e48..678a283 100644
--- a/arch/efi/efi/efi-device.c
+++ b/arch/efi/efi/efi-device.c
@@ -168,8 +168,10 @@ static struct efi_device *efi_add_device(efi_handle_t *handle, efi_guid_t **guid
 
 	efiret = BS->open_protocol(handle, &efi_device_path_protocol_guid,
 			&devpath, NULL, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-	if (EFI_ERROR(efiret))
+	if (EFI_ERROR(efiret)) {
+		free(guidarr);
 		return ERR_PTR(-EINVAL);
+	}
 
 	efidev = xzalloc(sizeof(*efidev));
 
-- 
2.5.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux