summaryrefslogtreecommitdiff
path: root/ext/intl/msgformat/msgformat.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/msgformat/msgformat.c')
-rwxr-xr-xext/intl/msgformat/msgformat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index b31db9d6f..84f14de1b 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;