Skip to content

Commit

Permalink
avformat/hls: Fix memleak when url is empty
Browse files Browse the repository at this point in the history
Fixes Coverity ID 1465888.

Reviewed-by: Steven Liu <[email protected]>
Signed-off-by: Andreas Rheinhardt <[email protected]>
  • Loading branch information
mkver committed Aug 18, 2020
1 parent ab384d2 commit dfc6a9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libavformat/hls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dfc6a9f

Please sign in to comment.