summaryrefslogtreecommitdiff
path: root/ext/phar/phar.c
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-09-26 16:29:44 +0000
committerGreg Beaver <cellog@php.net>2008-09-26 16:29:44 +0000
commit184777921027bb15082ca616501a8570d7bdfae9 (patch)
treecef3c0175afe7cd2697fe53b81fde848a9547e75 /ext/phar/phar.c
parent142ee7a89dbf5d1eda4a0f2b2436ebcdfc16f251 (diff)
downloadphp-git-184777921027bb15082ca616501a8570d7bdfae9.tar.gz
fix bug #46178: memory leak in ext/phar
Diffstat (limited to 'ext/phar/phar.c')
-rw-r--r--ext/phar/phar.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index b12628a777..4c351751f9 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -440,6 +440,11 @@ int phar_entry_delref(phar_entry_data *idata TSRMLS_DC) /* {{{ */
if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != idata->internal_file->fp) {
php_stream_close(idata->fp);
}
+ /* if phar_get_or_create_entry_data returns a sub-directory, we have to free it */
+ if (idata->internal_file->is_temp_dir) {
+ destroy_phar_manifest_entry((void *)idata->internal_file);
+ efree(idata->internal_file);
+ }
}
phar_archive_delref(idata->phar TSRMLS_CC);