aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-14 22:06:54 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:56 +0100
commitb03a87605096037e2e50a11e5b48de36b80be498 (patch)
treef74d8d27145b1217f01d7b8fcbeeb71756c858f3
parent4bc5de8e553873459f2bb93aecf2253fc99a0066 (diff)
downloadffmpeg-b03a87605096037e2e50a11e5b48de36b80be498.tar.gz
avformat/hls: Fix memleak when url is empty
Fixes Coverity ID 1465888. Reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit dfc6a9f07543e3c2bf01baaf8459558365f961d2)
-rw-r--r--libavformat/hls.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 3c7e197ce7..2baee52ded 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -311,8 +311,10 @@ static struct playlist *new_playlist(HLSContext *c, const char *url,
return NULL;
reset_packet(&pls->pkt);
ff_make_absolute_url(pls->url, sizeof(pls->url), base, url);
- if (!pls->url[0])
+ if (!pls->url[0]) {
+ av_free(pls);
return NULL;
+ }
pls->seek_timestamp = AV_NOPTS_VALUE;
pls->is_id3_timestamped = -1;