dmitry          Tue May  8 12:08:41 2007 UTC

  Modified files:              
    /php-src/ext/zlib   zlib_fopen_wrapper.c 
    /php-src/main/streams       streams.c 
  Log:
  Fixed bug #41304 (compress.zlib temp files left)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_fopen_wrapper.c?r1=1.49&r2=1.50&diff_format=u
Index: php-src/ext/zlib/zlib_fopen_wrapper.c
diff -u php-src/ext/zlib/zlib_fopen_wrapper.c:1.49 
php-src/ext/zlib/zlib_fopen_wrapper.c:1.50
--- php-src/ext/zlib/zlib_fopen_wrapper.c:1.49  Thu Apr 26 12:53:34 2007
+++ php-src/ext/zlib/zlib_fopen_wrapper.c       Tue May  8 12:08:41 2007
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: zlib_fopen_wrapper.c,v 1.49 2007/04/26 12:53:34 dmitry Exp $ */
+/* $Id: zlib_fopen_wrapper.c,v 1.50 2007/05/08 12:08:41 dmitry Exp $ */
 
 #define _GNU_SOURCE
 
@@ -76,7 +76,7 @@
                        self->gz_file = NULL;
                }
                if (self->stream) {
-                       php_stream_free(self->stream, PHP_STREAM_FREE_CLOSE | 
PHP_STREAM_FREE_PRESERVE_HANDLE);
+                       php_stream_close(self->stream);
                        self->stream = NULL;
                }
        }
@@ -130,7 +130,7 @@
                int fd;
 
                if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD, 
(void **) &fd, REPORT_ERRORS)) {
-                       self->gz_file = gzdopen(fd, mode);
+                       self->gz_file = gzdopen(dup(fd), mode);
                        self->stream = innerstream;
                        if (self->gz_file)      {
                                stream = 
php_stream_alloc_rel(&php_stream_gzio_ops, self, 0, mode);
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.150&r2=1.151&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.150 
php-src/main/streams/streams.c:1.151
--- php-src/main/streams/streams.c:1.150        Tue Mar  6 20:04:05 2007
+++ php-src/main/streams/streams.c      Tue May  8 12:08:41 2007
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.150 2007/03/06 20:04:05 pollita Exp $ */
+/* $Id: streams.c,v 1.151 2007/05/08 12:08:41 dmitry Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -2433,6 +2433,9 @@
                        case PHP_STREAM_UNCHANGED:
                                return stream;
                        case PHP_STREAM_RELEASED:
+                               if (newstream->orig_path) {
+                                       pefree(newstream->orig_path, 
persistent);
+                               }
                                newstream->orig_path = pestrdup(path, 
persistent);
                                return newstream;
                        default:

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

Reply via email to