cvs: php4(PHP_4_3) /ext/standard file.c
| From: | Wez Furlong | Date: | Mon, 26 May 2003 19:01:45 +0000 |
| Subject: | cvs: php4(PHP_4_3) /ext/standard file.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-21272@lists.php.net to get a copy of this message | ||
wez Mon May 26 15:01:45 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/standard file.c
Log:
Plug a leak - noticed by Ilia.
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.279.2.22 php4/ext/standard/file.c:1.279.2.23
--- php4/ext/standard/file.c:1.279.2.22 Mon May 19 20:21:57 2003
+++ php4/ext/standard/file.c Mon May 26 15:01:45 2003
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.279.2.22 2003/05/20 00:21:57 wez Exp $ */
+/* $Id: file.c,v 1.279.2.23 2003/05/26 19:01:45 wez Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -415,7 +415,7 @@
{
char *filename;
int filename_len;
- char *contents;
+ char *contents = NULL;
zend_bool use_include_path = 0;
php_stream *stream;
int len, newlen;
@@ -441,10 +441,15 @@
}
RETVAL_STRINGL(contents, len, 0);
+ contents = NULL;
} else if (len == 0) {
RETVAL_EMPTY_STRING();
} else {
RETVAL_FALSE;
+ }
+
+ if (contents) {
+ efree(contents);
}
php_stream_close(stream);