]> granicus.if.org Git - php/commitdiff
MFH: fix sapi_getenv() leak
authorRasmus Lerdorf <rasmus@php.net>
Mon, 26 Jun 2006 13:15:20 +0000 (13:15 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Mon, 26 Jun 2006 13:15:20 +0000 (13:15 +0000)
ext/standard/basic_functions.c

index c881df9397f516d84538d1c79c5d21d39bc164d0..0c38cc3e11ddf77f3671a50589b317b215173440 100644 (file)
@@ -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;
 }
 /* }}} */