ntdll: Clear ret->Buffer on failure in get_env_var() (Valgrind).

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2021-04-26 13:41:35 +02:00 committed by Alexandre Julliard
parent 0184f1d242
commit b9070e1153
1 changed files with 5 additions and 1 deletions

View File

@ -2616,7 +2616,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;
}
}