From e34f607d989fa22e480c7d293de0ee60bee76956 Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 7 Dec 2007 03:44:09 +0000 Subject: [PATCH] (read_mtext_element): Don't free the malloced buffer. --- src/plist.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/plist.c b/src/plist.c index 2e3cd22..45a32a6 100644 --- a/src/plist.c +++ b/src/plist.c @@ -290,15 +290,9 @@ read_mtext_element (MPlist *plist, MStream *st, int skip) if (! skip) { - MText *mt; - - if (buf == buffer) - mt = mtext__from_data (buf, i, MTEXT_FORMAT_UTF_8, 1); - else - { - mt = mtext__from_data (buf, i, MTEXT_FORMAT_UTF_8, 0); - free (buf); - } + MText *mt = mtext__from_data (buf, i, MTEXT_FORMAT_UTF_8, + (buf == buffer)); + mt->allocated = nbytes; MPLIST_SET_ADVANCE (plist, Mtext, mt); } return plist; -- 1.7.10.4