]> granicus.if.org Git - php/commitdiff
fix incorrect refcount increment on unlink()
authorGreg Beaver <cellog@php.net>
Sat, 27 Jan 2007 18:03:40 +0000 (18:03 +0000)
committerGreg Beaver <cellog@php.net>
Sat, 27 Jan 2007 18:03:40 +0000 (18:03 +0000)
ext/phar/phar.c

index 7bf714571722a617bd3aeec5eedb0f91d291a78b..eafe3d150e7fbfaee27687eb89dce27dd4d753f0 100644 (file)
@@ -2457,6 +2457,8 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int optio
                php_url_free(resource);
                return FAILURE;
        }
+       /* faulty increment of phar refcount - nothing persists beyond this function */
+       idata->phar->refcount--;
        if (idata->internal_file->fp_refcount > 1) {
                /* more than just our fp resource is open for this file */ 
                php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: \"%s\" in phar \"%s\", has open file pointers, cannot unlink", internal_file, resource->host);