Firmware implementations are generally pretty bad, hence let's better
add an explicit check for NULL before invokin FreePool(), in particular
is it doesn't appear to be documented whether FreePool() is supposed to
be happy with NULL.
EFI_STATUS file_read(EFI_FILE_HANDLE dir, CHAR16 *name, UINTN off, UINTN size, CHAR8 **content, UINTN *content_size);
static inline void FreePoolp(void *p) {
- FreePool(*(void**) p);
+ void *q = *(void**) p;
+
+ if (!q)
+ return;
+
+ FreePool(q);
}
#define _cleanup_(x) __attribute__((cleanup(x)))