From: handa Date: Fri, 7 Dec 2007 03:44:09 +0000 (+0000) Subject: (read_mtext_element): Don't free the malloced buffer. X-Git-Tag: REL-1-5-0~16 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=e34f607d989fa22e480c7d293de0ee60bee76956;p=m17n%2Fm17n-lib.git (read_mtext_element): Don't free the malloced buffer. --- 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;