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

index 600a294790ff67d9e9591162c09f919ee6693ac3..2d74ef338aa41e9c509b94e264402bf0373b85ee 100644 (file)
@@ -4308,14 +4308,10 @@ PHP_FUNCTION(getenv)
                RETURN_FALSE;
        }
        ptr = sapi_getenv(str, str_len TSRMLS_CC);
-       if(ptr) {
-               RETVAL_RT_STRING(ptr,1);
-               efree(ptr);
-       } else {
-               ptr = getenv(str);
-               if(ptr) RETURN_RT_STRING(ptr, 1);
-               else RETURN_FALSE;
-       }
+       if(ptr) RETURN_RT_STRING(ptr, 0);
+       ptr = getenv(str);
+       if(ptr) RETURN_RT_STRING(ptr, 1);
+       RETURN_FALSE;
 }
 /* }}} */