cvs: php4 /main fopen-wrappers.c
| From: | Andi Gutmans | Date: | Thu, 12 Oct 2000 19:58:21 +0000 |
| Subject: | cvs: php4 /main fopen-wrappers.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2035@lists.php.net to get a copy of this message | ||
andi Thu Oct 12 12:58:21 2000 EDT
Modified files:
/php4/main fopen-wrappers.c
Log:
- Fix memory leak.
Index: php4/main/fopen-wrappers.c
diff -u php4/main/fopen-wrappers.c:1.94 php4/main/fopen-wrappers.c:1.95
--- php4/main/fopen-wrappers.c:1.94 Tue Oct 3 08:05:50 2000
+++ php4/main/fopen-wrappers.c Thu Oct 12 12:58:20 2000
@@ -16,7 +16,7 @@
| Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: fopen-wrappers.c,v 1.94 2000/10/03 15:05:50 andi Exp $ */
+/* $Id: fopen-wrappers.c,v 1.95 2000/10/12 19:58:20 andi Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -975,6 +975,7 @@
new_state.cwd_length = strlen(cwd);
if(virtual_file_ex(&new_state, filepath, NULL)) {
+ free(new_state.cwd);
return NULL;
}
@@ -984,8 +985,8 @@
real_path[copy_len]='\0';
} else {
real_path = estrndup(new_state.cwd, new_state.cwd_length);
- free(new_state.cwd);
}
+ free(new_state.cwd);
return real_path;
}