From b253901e542f9e0fd118addd9c25c607928bd5f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E3=82=88=E3=82=84?= Date: Fri, 24 Jun 2011 14:59:54 +0900 Subject: [PATCH] =?utf8?q?0.37=20=E4=BB=A5=E5=89=8D=E3=81=AE=20shape=20?= =?utf8?q?=E5=BD=A2=E5=BC=8F=E3=82=92=E8=AA=AD=E3=82=80=E7=82=BA=E3=81=AE?= =?utf8?q?=20fallback=20=E5=87=A6=E7=90=86=E3=81=A7=20memory=20leak=20?= =?utf8?q?=E3=81=99=E3=82=8B=E4=B8=8D=E5=85=B7=E5=90=88=E3=82=92=E4=BF=AE?= =?utf8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/swf_object.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/swf_object.c b/src/swf_object.c index e6c6d18..28fc663 100644 --- a/src/swf_object.c +++ b/src/swf_object.c @@ -591,6 +591,9 @@ swf_object_replace_shapedata(swf_object_t *swf, int cid, new_tag = swf_tag_move(old_tag); swf_tag_destroy_detail(new_tag); new_tag->length = length + 2; + if (new_tag->data) { + free(new_tag->data); + } new_tag->data = malloc(length + 2); PutUShortLE(new_tag->data, cid); memcpy(new_tag->data + 2, data, length); @@ -602,6 +605,7 @@ swf_object_replace_shapedata(swf_object_t *swf, int cid, // 新しいタグに繋ぎかえる _swf_object_replace_tag(swf, old_tag, new_tag); swf_tag_destroy(old_tag); // 前のは消す + // 情報要素を編集したので生データは削除 free(new_tag->data); new_tag->data = NULL; return 0; -- 2.11.0