mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
avformat/hlsenc: Fix memleak when deleting old segments
if the directory name of the segments contains "%v". This memleak is caused by masking the pointer that will eventually be freed by a variable of the same name in a smaller scope. Therefore the pointer that gets freed is always NULL when it is freed and the allocated data leaks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
95e9cf813e
commit
de8f6a4033
@ -532,7 +532,6 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
|
|||||||
/* if %v is present in the file's directory
|
/* if %v is present in the file's directory
|
||||||
* all segment belongs to the same variant, so do it only once before the loop*/
|
* all segment belongs to the same variant, so do it only once before the loop*/
|
||||||
if (dirname && av_stristr(dirname, "%v")) {
|
if (dirname && av_stristr(dirname, "%v")) {
|
||||||
char * dirname_repl = dirname;
|
|
||||||
if (!vs->varname) {
|
if (!vs->varname) {
|
||||||
if (replace_int_data_in_filename(&dirname_repl, dirname, 'v', segment->var_stream_idx) < 1) {
|
if (replace_int_data_in_filename(&dirname_repl, dirname, 'v', segment->var_stream_idx) < 1) {
|
||||||
ret = AVERROR(EINVAL);
|
ret = AVERROR(EINVAL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user