rasmus          Mon Jun 26 13:03:41 2006 UTC

  Modified files:              
    /php-src/ext/standard       basic_functions.c 
  Log:
  sapi_getenv() estrdups the returned string now, so we need to free it
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.780&r2=1.781&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.780 
php-src/ext/standard/basic_functions.c:1.781
--- php-src/ext/standard/basic_functions.c:1.780        Mon Jun 26 11:31:19 2006
+++ php-src/ext/standard/basic_functions.c      Mon Jun 26 13:03:41 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.780 2006/06/26 11:31:19 bjori Exp $ */
+/* $Id: basic_functions.c,v 1.781 2006/06/26 13:03:41 rasmus Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -4308,13 +4308,14 @@
                RETURN_FALSE;
        }
        ptr = sapi_getenv(str, str_len TSRMLS_CC);
-       if (! ptr) {
+       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, 1);
-       }
-       RETURN_FALSE;
 }
 /* }}} */
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to