Don't leak newlist if we error out.
Fixes: 74c16acce30b ("efi_loader: Don't allocate from memory holes")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* The user requested to only have RAM overlaps,
* but we hit a non-RAM region. Error out.
*/
+ free(newlist);
return EFI_NO_MAPPING;
case EFI_CARVE_NO_OVERLAP:
/* Just ignore this list entry */
* The payload wanted to have RAM overlaps, but we overlapped
* with an unallocated region. Error out.
*/
+ free(newlist);
return EFI_NO_MAPPING;
}