diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2019-10-10 10:07:49 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2019-10-28 14:26:04 +0800 |
commit | 1a109fba5499f95d3d0cc526a912f9e71446c812 (patch) | |
tree | 26ca9d600f8b6079ad603e36e4f803096ea9cdba /libavformat/hlsenc.c | |
parent | ebff4bbd82c371bab6635de5793ce93c1f62642d (diff) | |
download | ffmpeg-1a109fba5499f95d3d0cc526a912f9e71446c812.tar.gz |
avformat/hlsenc: move freep segment from sls_flags_filename_process after caller failed
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r-- | libavformat/hlsenc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 7b1d54e23e..0876f72f13 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -889,7 +889,6 @@ static int sls_flags_filename_process(struct AVFormatContext *s, HLSContext *hls strlen(vs->current_segment_final_filename_fmt)) { char * new_url = av_strdup(vs->current_segment_final_filename_fmt); if (!new_url) { - av_freep(&en); return AVERROR(ENOMEM); } ff_format_set_url(vs->avf, new_url); @@ -901,7 +900,6 @@ static int sls_flags_filename_process(struct AVFormatContext *s, HLSContext *hls "you can try to remove second_level_segment_size flag\n", vs->avf->url); av_freep(&filename); - av_freep(&en); return AVERROR(EINVAL); } ff_format_set_url(vs->avf, filename); @@ -915,7 +913,6 @@ static int sls_flags_filename_process(struct AVFormatContext *s, HLSContext *hls "you can try to remove second_level_segment_time flag\n", vs->avf->url); av_freep(&filename); - av_freep(&en); return AVERROR(EINVAL); } ff_format_set_url(vs->avf, filename); @@ -1037,6 +1034,7 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, en->var_stream_idx = vs->var_stream_idx; ret = sls_flags_filename_process(s, hls, vs, en, duration, pos, size); if (ret < 0) { + av_freep(&en); return ret; } |