]> granicus.if.org Git - php/commitdiff
- Fixed bug #61829 (Memory leak when calling MessageFormatter's constructor twice)
authorFelipe Pena <felipensp@gmail.com>
Mon, 23 Apr 2012 18:18:12 +0000 (15:18 -0300)
committerFelipe Pena <felipensp@gmail.com>
Mon, 23 Apr 2012 18:18:12 +0000 (15:18 -0300)
ext/intl/msgformat/msgformat.c

index b31db9d6ff39dc6c8e8b82f6cbac250334741fb1..84f14de1bdc3097e34a53171224f8a5ef30f714f 100755 (executable)
@@ -68,6 +68,10 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
                INTL_CTOR_CHECK_STATUS(mfo, "msgfmt_create: error converting pattern to quote-friendly format");
        }
 
+       if ((mfo)->mf_data.orig_format) {
+               msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+       }
+
        (mfo)->mf_data.orig_format = estrndup(pattern, pattern_len);
        (mfo)->mf_data.orig_format_len = pattern_len;