wez             Tue Oct 15 12:38:11 2002 EDT

  Modified files:              
    /php4/main  streams.c 
  Log:
  Fix mem leak for zero-byte files.
  
  
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.106 php4/main/streams.c:1.107
--- php4/main/streams.c:1.106   Tue Oct 15 12:04:46 2002
+++ php4/main/streams.c Tue Oct 15 12:38:11 2002
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.106 2002/10/15 16:04:46 wez Exp $ */
+/* $Id: streams.c,v 1.107 2002/10/15 16:38:11 wez Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -1028,7 +1028,7 @@
 #endif
                
                        srcfile = mmap(NULL, maxlen, PROT_READ, MAP_SHARED, srcfd, 0);
-                       if (srcfile != (void*)MAP_FAILED) {
+                       if (srcfile != (void*)MAP_FAILED && ret > 0) {
 
                                *buf = pemalloc_rel_orig(maxlen + 1, persistent);
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to