summaryrefslogtreecommitdiff
path: root/libavformat/hls.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-14 22:06:54 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-18 07:02:43 +0200
commitdfc6a9f07543e3c2bf01baaf8459558365f961d2 (patch)
tree46a8210eb069ea72e00e8dfbc91c6e732b112803 /libavformat/hls.c
parentab384d289df61127f867c362b8cab49cafe5ed8c (diff)
downloadffmpeg-dfc6a9f07543e3c2bf01baaf8459558365f961d2.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>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r--libavformat/hls.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 84f0a5f323..4a3e0d6842 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;