diff options
author | Rasmus Lerdorf <rasmus@php.net> | 2006-06-26 13:15:20 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 2006-06-26 13:15:20 +0000 |
commit | 862c4d23450ec198eb8c325917c06380bc6acaa3 (patch) | |
tree | 98b9826357eefea415e2e7dae6512e56db98b0c9 | |
parent | 563c920c241c3edfcb7f78df96b1561980f25d29 (diff) | |
download | php-git-862c4d23450ec198eb8c325917c06380bc6acaa3.tar.gz |
MFH: fix sapi_getenv() leak
-rw-r--r-- | ext/standard/basic_functions.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index c881df9397..0c38cc3e11 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1427,12 +1427,9 @@ PHP_FUNCTION(getenv) RETURN_FALSE; } ptr = sapi_getenv(str, str_len TSRMLS_CC); - if (! ptr) { - ptr = getenv(str); - } - if (ptr) { - RETURN_STRING(ptr, 1); - } + if(ptr) RETURN_STRING(ptr, 0); + ptr = getenv(str); + if(ptr) RETURN_STRING(ptr, 1); RETURN_FALSE; } /* }}} */ |