mirror of
https://github.com/php/php-src.git
synced 2026-04-25 08:58:28 +02:00
Fix memory leak
This commit is contained in:
@@ -4088,11 +4088,13 @@ PHP_FUNCTION(getenv)
|
||||
size = GetEnvironmentVariableW(keyw, &dummybuf, 0);
|
||||
if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
|
||||
/* The environment variable doesn't exist. */
|
||||
free(keyw);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (size == 0) {
|
||||
/* env exists, but it is empty */
|
||||
free(keyw);
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user