]> granicus.if.org Git - php/commitdiff
fix double free
authorAnatol Belski <ab@php.net>
Mon, 29 Aug 2016 17:27:47 +0000 (19:27 +0200)
committerAnatol Belski <ab@php.net>
Mon, 29 Aug 2016 17:27:47 +0000 (19:27 +0200)
ext/intl/msgformat/msgformat_format.c

index 55ec9e84ba0e8ed5243c59cf0481e0efd5d653b0..25c9619133d6fe8d6cd32d2702b0eb4cf829efe2 100644 (file)
@@ -51,11 +51,10 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
        zend_hash_destroy(args_copy);
        efree(args_copy);
 
-       if (formatted && U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
-                       efree(formatted);
-       }
-
        if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
+               if (formatted) {
+                       efree(formatted);
+               }
                RETURN_FALSE;
        } else {
                INTL_METHOD_RETVAL_UTF8(mfo, formatted, formatted_len, 1);