Skip to content

Commit

Permalink
avformat/hlsenc: move freep segment from sls_flags_filename_process a…
Browse files Browse the repository at this point in the history
…fter caller failed

Signed-off-by: Steven Liu <[email protected]>
  • Loading branch information
T-bagwell committed Oct 28, 2019
1 parent ebff4bb commit 1a109fb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libavformat/hlsenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 1a109fb

Please sign in to comment.