This is a copy/paste of the exact same code in both cases: Buffer
should only be freed on the success path, otherwise it will be
NULL
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ronald Cron <Ronald.Cron@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17078
6f19259b-4bc3-4df7-8a09-
765794883524
*Handle = Buffer[0];\r
Status = gBS->HandleProtocol (*Handle, Protocol, Interface);\r
ASSERT_EFI_ERROR(Status);\r
+ FreePool (Buffer);\r
}\r
- FreePool (Buffer);\r
} else {\r
Status = EFI_SUCCESS;\r
}\r
*Handle = Buffer[0];\r
Status = gBS->HandleProtocol (*Handle, Protocol, Interface);\r
ASSERT_EFI_ERROR (Status);\r
+ FreePool (Buffer);\r
}\r
- FreePool (Buffer);\r
} else {\r
Status = EFI_SUCCESS;\r
}\r