diff --git a/stand/efi/libefi/efichar.c b/stand/efi/libefi/efichar.c index e5e57741c49a..233027f4e6ea 100644 --- a/stand/efi/libefi/efichar.c +++ b/stand/efi/libefi/efichar.c @@ -139,6 +139,8 @@ utf8_to_ucs2(const char *name, efi_char **nmp, size_t *len) sz = strlen(name) * 2 + 2; if (*nmp == NULL) *nmp = malloc(sz); + if (*nmp == NULL) + return (ENOMEM); nm = *nmp; *len = sz;