1
0
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:
Anatol Belski
2017-11-27 20:24:30 +01:00
parent 2b7d283cc5
commit 2868ff84df
+2
View File
@@ -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();
}