mirror of
https://github.com/php/php-src.git
synced 2026-04-28 10:43:30 +02:00
Fix allocation
This commit is contained in:
@@ -4098,7 +4098,7 @@ PHP_FUNCTION(getenv)
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
|
||||
valw = emalloc(size);
|
||||
valw = emalloc((size + 1) * sizeof(wchar_t));
|
||||
size = GetEnvironmentVariableW(keyw, valw, size);
|
||||
if (size == 0) {
|
||||
/* has been removed between the two calls */
|
||||
|
||||
Reference in New Issue
Block a user