cvs: php-src /main/streams streams.c
| From: | Hannes Magnusson | Date: | Tue, 20 Jun 2006 18:09:33 +0000 |
| Subject: | cvs: php-src /main/streams streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-38819@lists.php.net to get a copy of this message | ||
bjori Tue Jun 20 18:09:33 2006 UTC
Modified files:
/php-src/main/streams streams.c
Log:
Plug memleak (leaks on empty files)
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.124&r2=1.125&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.124 php-src/main/streams/streams.c:1.125
--- php-src/main/streams/streams.c:1.124 Sun May 14 18:35:40 2006
+++ php-src/main/streams/streams.c Tue Jun 20 18:09:33 2006
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.124 2006/05/14 18:35:40 helly Exp $ */
+/* $Id: streams.c,v 1.125 2006/06/20 18:09:33 bjori Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -1635,7 +1635,7 @@
p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, PHP_STREAM_MAP_MODE_SHARED_READONLY,
&mapped);
- if (p) {
+ if (p && mapped) {
*buf = pemalloc_rel_orig(mapped + 1, persistent);
if (*buf) {