From: yoya Date: Thu, 17 Mar 2011 07:33:15 +0000 (+0000) Subject: calloc 直後のエラーで free するのを、エラーの後で calloc するよう変更 X-Git-Tag: v0_60~319 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=405a78411ef7dc566c2b6d818eef2680cb588364;p=swfed%2Fswfed.git calloc 直後のエラーで free するのを、エラーの後で calloc するよう変更 git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/swfed/trunk@435 7c90b180-03d5-4157-b861-58a559ae9d1e --- diff --git a/src/swf_tag.c b/src/swf_tag.c index b105cd7..f7cae1d 100644 --- a/src/swf_tag.c +++ b/src/swf_tag.c @@ -84,13 +84,12 @@ swf_tag_t *swf_tag_create(bitstream_t *bs) { fprintf(stderr, "swf_tag_create: bs == NULL\n"); return NULL; } - tag = calloc(sizeof(*tag), 1); tag_and_length = bitstream_getbytesLE(bs, 2); if (tag_and_length == (unsigned short) -1) { fprintf(stderr, "swf_tag_create: tag_and_length(short) == -1\n"); - free(tag); return NULL; } + tag = calloc(sizeof(*tag), 1); tag->tag = tag_and_length >> 6; tag->length = tag_and_length & 0x3f; tag->length_longformat = 0;