From ff8804a55c04e5386cf8dd1c5c19f0b3f6c4bef2 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Sat, 30 Dec 2023 16:41:29 -0500 Subject: [PATCH] MT#55283 fix possible mem leak Warned-by: Coverity Change-Id: I6a1f398272be2929f1157ed0ecdb667e26d3797a (cherry picked from commit a968afcd1d95fe4ba9596922c20823e19e144a2f) --- perf-tester/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/perf-tester/main.c b/perf-tester/main.c index 9c04990e7..1b31e7391 100644 --- a/perf-tester/main.c +++ b/perf-tester/main.c @@ -674,10 +674,12 @@ static char *start_dump_stream(struct stream *s, const char *suffix) { s->avst->codecpar->sample_rate = s->out_params.clock_rate; s->avst->time_base = (AVRational) {1, s->out_params.clock_rate}; // TODO: is this the correct time base? + err = NULL; int ret = avio_open(&s->fmtctx->pb, fn, AVIO_FLAG_WRITE); - msg = g_strdup_printf("Failed to open output file '%s'", fn); - if (ret < 0) + if (ret < 0) { + msg = g_strdup_printf("Failed to open output file '%s'", fn); goto out; + } err = "Failed to write file header"; ret = avformat_write_header(s->fmtctx, NULL); if (ret < 0)