Module: wine Branch: master Commit: cd2d80982223a49fdc2931ac39bad4a65e5b286a URL: https://source.winehq.org/git/wine.git/?a=commit;h=cd2d80982223a49fdc2931ac3...
Author: André Hentschel nerv@dawncrow.de Date: Wed Jun 26 19:29:18 2019 +0200
kernelbase: Return on failed allocation (Coverity).
Signed-off-by: André Hentschel nerv@dawncrow.de Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/kernelbase/registry.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/kernelbase/registry.c b/dlls/kernelbase/registry.c index f218ffc..f2b0af9 100644 --- a/dlls/kernelbase/registry.c +++ b/dlls/kernelbase/registry.c @@ -2680,9 +2680,11 @@ static LONG load_mui_string(const WCHAR *file_name, UINT res_id, WCHAR *buffer, return ERROR_FILE_NOT_FOUND;
size = GetFullPathNameW(file_name, 0, NULL, NULL); - full_name = heap_alloc(size * sizeof(WCHAR)); if (!size) return GetLastError(); + full_name = heap_alloc(size * sizeof(WCHAR)); + if (!full_name) + return ERROR_NOT_ENOUGH_MEMORY; GetFullPathNameW(file_name, size, full_name, NULL);
EnterCriticalSection(®_mui_cs);