cvs: TSRM / tsrm_virtual_cwd.c php-src NEWS
| From: | Ilia Alshanetsky | Date: | Tue, 09 Mar 2004 14:50:11 +0000 |
| Subject: | cvs: TSRM / tsrm_virtual_cwd.c php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2456@lists.php.net to get a copy of this message | ||
iliaa Tue Mar 9 09:50:11 2004 EDT
Modified files:
/php-src NEWS
/TSRM tsrm_virtual_cwd.c
Log:
Fixed bug #27338 (memory leak inside tsrm_virtual_cwd.c on win32).
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1625&r2=1.1626&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1625 php-src/NEWS:1.1626
--- php-src/NEWS:1.1625 Mon Mar 8 17:18:02 2004
+++ php-src/NEWS Tue Mar 9 09:50:09 2004
@@ -21,6 +21,7 @@
- Fixed problem preventing startup errors from being displayed. (Marcus)
- Fixed start-up problem if both SPL and SimpleXML were enabled. The double
initialization of apache 1.3 was causing problems here. (Marcus, Derick)
+- Fixed bug #27338 (memory leak inside tsrm_virtual_cwd.c on win32). (Ilia)
- Fixed bug #27287 (wddx segfaults during deserialization). (Moriyoshi)
- Fixed bug #27263 (session extension crashes when unserializing referenced
values / objects). (Moriyoshi)
http://cvs.php.net/diff.php/TSRM/tsrm_virtual_cwd.c?r1=1.60&r2=1.61&ty=u
Index: TSRM/tsrm_virtual_cwd.c
diff -u TSRM/tsrm_virtual_cwd.c:1.60 TSRM/tsrm_virtual_cwd.c:1.61
--- TSRM/tsrm_virtual_cwd.c:1.60 Thu Jan 8 03:14:03 2004
+++ TSRM/tsrm_virtual_cwd.c Tue Mar 9 09:50:11 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_virtual_cwd.c,v 1.60 2004/01/08 08:14:03 andi Exp $ */
+/* $Id: tsrm_virtual_cwd.c,v 1.61 2004/03/09 14:50:11 iliaa Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
@@ -302,6 +302,7 @@
unsigned char is_absolute = 0;
#ifndef TSRM_WIN32
char resolved_path[MAXPATHLEN];
+ char *new_path;
#endif
if (path_length == 0)
@@ -340,7 +341,6 @@
#if defined(TSRM_WIN32)
{
char *dummy = NULL;
- char *new_path;
int new_path_length;
new_path_length = GetLongPathName(path, dummy, 0) + 1;
@@ -357,6 +357,7 @@
path_length = new_path_length;
} else {
free(new_path);
+ new_path = NULL;
}
}
#endif
@@ -463,7 +464,11 @@
}
free(old_state);
-
+#ifdef TSRM_WIN32
+ if (new_path) {
+ free(new_path);
+ }
+#endif
free(free_path);
#if VIRTUAL_CWD_DEBUG
fprintf (stderr, "virtual_file_ex() = %s\n",state->cwd);