]> granicus.if.org Git - php/commitdiff
Fixed access to freed memory
authorDmitry Stogov <dmitry@php.net>
Fri, 18 Jul 2008 09:35:51 +0000 (09:35 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 18 Jul 2008 09:35:51 +0000 (09:35 +0000)
ext/phar/stream.c

index a1c30b22df9172aa19bad8d30f281dd9e92d98d0..f70af7143ed3ac88df0068266e5f616ec9f44c49 100644 (file)
@@ -347,10 +347,11 @@ phar_stub:
 static int phar_stream_close(php_stream *stream, int close_handle TSRMLS_DC) /* {{{ */
 {
        phar_entry_info *entry = ((phar_entry_data *)stream->abstract)->internal_file;
+       int is_temp_dir = entry->is_temp_dir;
 
        phar_entry_delref((phar_entry_data *)stream->abstract TSRMLS_CC);
 
-       if (entry->is_temp_dir) {
+       if (is_temp_dir) {
                /* phar archive stub, free it */
                efree(entry);
        }