From: Marcus Boerger Date: Thu, 31 May 2007 06:55:14 +0000 (+0000) Subject: - Fix memory issue X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~568 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ecc0f7fad0356647ae02c193f185931bc6192c2;p=php - Fix memory issue --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 36af2057c0..fb654a26fd 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1421,7 +1421,7 @@ int phar_split_fname(char *filename, int filename_len, char **arch, int *arch_le static php_url* phar_open_url(php_stream_wrapper *wrapper, char *filename, char *mode, int options TSRMLS_DC) /* {{{ */ { php_url *resource; - char *arch, *entry = NULL, *error; + char *arch = NULL, *entry = NULL, *error; int arch_len, entry_len; if (!strncasecmp(filename, "phar://", 7)) { @@ -1431,7 +1431,9 @@ static php_url* phar_open_url(php_stream_wrapper *wrapper, char *filename, char } if (phar_split_fname(filename, strlen(filename), &arch, &arch_len, &entry, &entry_len TSRMLS_CC) == FAILURE) { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: invalid url \"%s\" (cannot contain .phar.php and .phar.gz/.phar.bz2)", filename); - efree(arch); + if (arch) { + efree(arch); + } if (entry) { efree(entry); }