Commit 23c06984 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'cigaes/master'

* cigaes/master:
  lavf/tee: fix leak of bsfs array.
  lavf/tee: fix leak of select option.
  lavf/tee: fix leak of strdup/strtoked buffer.
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents d47e14b5 c4e6024a
...@@ -102,10 +102,10 @@ fail: ...@@ -102,10 +102,10 @@ fail:
static int parse_bsfs(void *log_ctx, const char *bsfs_spec, static int parse_bsfs(void *log_ctx, const char *bsfs_spec,
AVBitStreamFilterContext **bsfs) AVBitStreamFilterContext **bsfs)
{ {
char *bsf_name, *buf, *saveptr; char *bsf_name, *buf, *dup, *saveptr;
int ret = 0; int ret = 0;
if (!(buf = av_strdup(bsfs_spec))) if (!(dup = buf = av_strdup(bsfs_spec)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
while (bsf_name = av_strtok(buf, ",", &saveptr)) { while (bsf_name = av_strtok(buf, ",", &saveptr)) {
...@@ -128,7 +128,7 @@ static int parse_bsfs(void *log_ctx, const char *bsfs_spec, ...@@ -128,7 +128,7 @@ static int parse_bsfs(void *log_ctx, const char *bsfs_spec,
} }
end: end:
av_free(buf); av_free(dup);
return ret; return ret;
} }
...@@ -280,6 +280,7 @@ static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave) ...@@ -280,6 +280,7 @@ static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
end: end:
av_free(format); av_free(format);
av_free(select);
av_dict_free(&options); av_dict_free(&options);
return ret; return ret;
} }
...@@ -302,6 +303,7 @@ static void close_slaves(AVFormatContext *avf) ...@@ -302,6 +303,7 @@ static void close_slaves(AVFormatContext *avf)
} }
} }
av_freep(&tee->slaves[i].stream_map); av_freep(&tee->slaves[i].stream_map);
av_freep(&tee->slaves[i].bsfs);
avio_close(avf2->pb); avio_close(avf2->pb);
avf2->pb = NULL; avf2->pb = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment