diff --git a/libavformat/segment.c b/libavformat/segment.c index 858ccf8697..5cc9eb812f 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -664,6 +664,7 @@ static void seg_free(AVFormatContext *s) seg->avf = NULL; av_freep(&seg->times); av_freep(&seg->frames); + av_freep(&seg->cur_entry.filename); } static int seg_init(AVFormatContext *s) @@ -983,7 +984,6 @@ fail: ff_format_io_close(s, &seg->list_pb); av_opt_free(seg); - av_freep(&seg->cur_entry.filename); cur = seg->segment_list_entries; while (cur) {