avformat/ffmenc: Fix memleak of buf

Fixes CID1257015

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-02-18 14:30:15 +01:00
parent 8087632027
commit c8c10a5fc7

View File

@ -146,8 +146,8 @@ static int ffm_write_header_codec_ctx(AVIOContext *pb, AVCodecContext *ctx, unsi
if (need_coma)
avio_w8(tmp, ',');
avio_write(tmp, buf, strlen(buf));
av_free(buf);
}
av_freep(&buf);
avio_w8(tmp, 0);
write_header_chunk(pb, tmp, tag);
return 0;