SOURCES: php-ini-search-path.patch - fix memleak on binary_location

glen glen at pld-linux.org
Mon Jun 12 10:38:04 CEST 2006


Author: glen                         Date: Mon Jun 12 08:38:04 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix memleak on binary_location

---- Files affected:
SOURCES:
   php-ini-search-path.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/php-ini-search-path.patch
diff -u SOURCES/php-ini-search-path.patch:1.1 SOURCES/php-ini-search-path.patch:1.2
--- SOURCES/php-ini-search-path.patch:1.1	Tue Jan 17 16:05:40 2006
+++ SOURCES/php-ini-search-path.patch	Mon Jun 12 10:37:59 2006
@@ -1,6 +1,19 @@
 see also http://bugs.php.net/bug.php?id=34793
---- php-5.1.2/main/php_ini.c~	2006-01-12 23:46:12.000000000 +0200
-+++ php-5.1.2/main/php_ini.c	2006-01-17 17:01:16.000000000 +0200
+
+--- php-5.1.2/main/php_ini.c	2006-01-17 17:01:16.000000000 +0200
++++ php-5.1.4/main/php_ini.c	2006-06-12 11:16:06.594944020 +0300
+@@ -291,10 +291,10 @@
+ 	} else if (!sapi_module.php_ini_ignore) {
+ 		char *default_location;
+ 		char *env_location;
+-		char *binary_location;
+ 		static const char paths_separator[] = { ZEND_PATHS_SEPARATOR, 0 };
+ #ifdef PHP_WIN32
+ 		char *reg_location;
++		char *binary_location;
+ #endif
+ 
+ 		env_location = getenv("PHPRC");
 @@ -330,6 +330,7 @@
  			strcat(php_ini_search_path, env_location);
  		}
@@ -9,7 +22,7 @@
  		/* Add cwd (only with CLI) */
  		if (strcmp(sapi_module.name, "cli") == 0) {
  			if (*php_ini_search_path) {
-@@ -339,7 +340,6 @@
+@@ -339,23 +340,12 @@
  		}
  
  		/* Add binary directory */
@@ -17,16 +30,24 @@
  		binary_location = (char *) emalloc(MAXPATHLEN);
  		if (GetModuleFileName(0, binary_location, MAXPATHLEN) == 0) {
  			efree(binary_location);
-@@ -356,6 +356,8 @@
  			binary_location = NULL;
  		}
- #endif
+-#else
+-		if (sapi_module.executable_location) {
+-			binary_location = (char *)emalloc(PATH_MAX);
+-			if (!realpath(sapi_module.executable_location, binary_location)) {
+-				efree(binary_location);
+-				binary_location = NULL;			 
+-			}
+-		} else {
+-			binary_location = NULL;
+-		}
+-#endif
 +
-+#ifdef PHP_WIN32
  		if (binary_location) {
  			char *separator_location = strrchr(binary_location, DEFAULT_SLASH);
  			
-@@ -370,7 +372,6 @@
+@@ -370,7 +360,6 @@
  		}
  
  		/* Add default location */
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/php-ini-search-path.patch?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list