Skip to content

Commit ca55c86

Browse files
committed
fix(report): guard JSON report cleanup to prevent test failures
1 parent 25a5fcb commit ca55c86

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/lib_ccx/params_dump.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,10 @@ void print_file_report(struct lib_ccx_ctx *ctx)
565565
struct lib_cc_decode *dec_ctx = NULL;
566566
struct ccx_demuxer *demux_ctx = ctx->demux_ctx;
567567
const char *report_fmt = ccx_options.report_format;
568+
int is_json = 0;
568569
if (report_fmt && strcasecmp(report_fmt, "json") == 0)
569570
{
571+
is_json = 1;
570572
print_file_report_json(ctx);
571573
goto cleanup;
572574
}
@@ -733,7 +735,10 @@ void print_file_report(struct lib_ccx_ctx *ctx)
733735
}
734736

735737
cleanup:
736-
freep(&ctx->freport.data_from_608);
737-
memset(&ctx->freport, 0, sizeof(struct file_report));
738+
if (is_json)
739+
{
740+
freep(&ctx->freport.data_from_608);
741+
memset(&ctx->freport, 0, sizeof(struct file_report));
742+
}
738743
#undef Y_N
739744
}

0 commit comments

Comments
 (0)