File php-CVE-2015-2301.patch of Package php5.openSUSE_Leap_42.1_Update

X-Git-Url: http://72.52.91.13:8000/?p=php-src.git;a=blobdiff_plain;f=ext%2Fphar%2Fphar_object.c;h=712795b1a4f863cea7b0a224e3adf3caa42ab881;hp=3671054b816f267f63cdd951146eeb3ac0cd54eb;hb=b2cf3f064b8f5efef89bb084521b61318c71781b;hpb=4c5995b1729b100b00707ddf32d072355dcc3ae8

--- ext/phar/phar_object.c
+++ ext/phar/phar_object.c
@@ -2139,8 +2139,8 @@ static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool c
 	}
 its_ok:
 	if (SUCCESS == php_stream_stat_path(newpath, &ssb)) {
-		efree(oldpath);
 		zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "phar \"%s\" exists and must be unlinked prior to conversion", newpath);
+		efree(oldpath);
 		return NULL;
 	}
 	if (!phar->is_data) {
openSUSE Build Service is sponsored by