api: added missing allocation-failure check

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2020-10-15 12:22:15 +02:00 committed by Jason A. Donenfeld
parent 0ad302c11d
commit 3058f1e57e

View File

@ -21,6 +21,8 @@ NormalizeStringAlloc(_In_ NORM_FORM NormForm, _In_z_ const WCHAR *Source)
if (Result)
HeapFree(Heap, 0, Result);
Result = HeapAlloc(Heap, 0, sizeof(WCHAR) * Len);
if (!Result)
return NULL;
Len = NormalizeString(NormForm, Source, -1, Result, Len);
if (Len > 0)
return Result;