cvs: php-src(PHP_5_2) /main/streams plain_wrapper.c
| From: | Ilia Alshanetsky | Date: | Tue, 13 Feb 2007 23:39:14 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /main/streams plain_wrapper.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-43055@lists.php.net to get a copy of this message | ||
iliaa Tue Feb 13 23:39:14 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/main/streams plain_wrapper.c
Log:
Fixed a memory leak on highlight_file() with a non-existant file
http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.52.2.6.2.14&r2=1.52.2.6.2.15&diff_format=u
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.52.2.6.2.14
php-src/main/streams/plain_wrapper.c:1.52.2.6.2.15
--- php-src/main/streams/plain_wrapper.c:1.52.2.6.2.14 Mon Jan 1 09:36:12 2007
+++ php-src/main/streams/plain_wrapper.c Tue Feb 13 23:39:14 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: plain_wrapper.c,v 1.52.2.6.2.14 2007/01/01 09:36:12 sebastian Exp $ */
+/* $Id: plain_wrapper.c,v 1.52.2.6.2.15 2007/02/13 23:39:14 iliaa Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -889,12 +889,12 @@
*opened_path = realpath;
realpath = NULL;
}
- if (realpath) {
- efree(realpath);
- }
/* fall through */
case PHP_STREAM_PERSISTENT_FAILURE:
+ if (realpath) {
+ efree(realpath);
+ }
efree(persistent_id);;
return ret;
}
@@ -933,6 +933,10 @@
r = do_fstat(self, 0);
if ((r == 0 && !S_ISREG(self->sb.st_mode))) {
+ if (opened_path) {
+ efree(*opened_path);
+ *opened_path = NULL;
+ }
php_stream_close(ret);
return NULL;
}