avformat/matroskaenc: use av_freep() to avoid leaving stale pointers

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-11 13:19:51 +02:00
parent 2175f76894
commit b5b34c1983

View File

@ -365,7 +365,7 @@ static int64_t mkv_write_seekhead(AVIOContext *pb, mkv_seekhead *seekhead)
currentpos = seekhead->filepos; currentpos = seekhead->filepos;
} }
fail: fail:
av_free(seekhead->entries); av_freep(&seekhead->entries);
av_free(seekhead); av_free(seekhead);
return currentpos; return currentpos;
@ -1685,7 +1685,7 @@ static int mkv_write_trailer(AVFormatContext *s)
} }
end_ebml_master(pb, mkv->segment); end_ebml_master(pb, mkv->segment);
av_free(mkv->tracks); av_freep(&mkv->tracks);
av_freep(&mkv->cues->entries); av_freep(&mkv->cues->entries);
av_freep(&mkv->cues); av_freep(&mkv->cues);