Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/ntdll/loader.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 38dd276608b..e71564d065b 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2604,7 +2604,11 @@ static NTSTATUS get_env_var( const WCHAR *name, SIZE_T extra, UNICODE_STRING *re return status; } RtlFreeHeap( GetProcessHeap(), 0, ret->Buffer ); - if (status != STATUS_BUFFER_TOO_SMALL) return status; + if (status != STATUS_BUFFER_TOO_SMALL) + { + ret->Buffer = NULL; + return status; + } size = len + 1 + extra; } }