diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 3c873e5357..03b06cabe8 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2579,9 +2579,8 @@ static int hls_write_trailer(struct AVFormatContext *s) vs->size = range_length; hlsenc_io_close(s, &vs->out, filename); - av_free(filename); - failed: + av_free(filename); av_write_trailer(oc); if (oc->url[0]) { proto = avio_find_protocol_name(oc->url);