diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 18173cdce1..3c873e5357 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2538,6 +2538,7 @@ static int hls_write_trailer(struct AVFormatContext *s) filename = av_asprintf("%s", vs->avf->url); } if (!filename) { + av_free(old_filename); return AVERROR(ENOMEM); }