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>
pull/346/head
Andreas Rheinhardt 4 years ago
parent ab384d289d
commit dfc6a9f075
  1. 4
      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;

Loading…
Cancel
Save