diff options
author | Felipe Pena <felipensp@gmail.com> | 2012-04-23 15:18:12 -0300 |
---|---|---|
committer | Felipe Pena <felipensp@gmail.com> | 2012-04-23 15:18:12 -0300 |
commit | c8865e3b84c9a3d08811b3b8f954defcd8fb621d (patch) | |
tree | a735efadc7ef86f77fd5db3ac1710895bf6d9e9d | |
parent | da1b5346017899d1f09c908eee2d166249160293 (diff) | |
download | php-git-c8865e3b84c9a3d08811b3b8f954defcd8fb621d.tar.gz |
- Fixed bug #61829 (Memory leak when calling MessageFormatter's constructor twice)
-rwxr-xr-x | ext/intl/msgformat/msgformat.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c index b31db9d6ff..84f14de1bd 100755 --- a/ext/intl/msgformat/msgformat.c +++ b/ext/intl/msgformat/msgformat.c @@ -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; |