Skip to content

Commit ab2cda5

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

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib_ccx/params_dump.c

Lines changed: 6 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,9 @@ 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+
freep(&ctx->freport.data_from_608);
740+
memset(&ctx->freport, 0, sizeof(struct file_report));
741+
}
738742
#undef Y_N
739743
}

0 commit comments

Comments
 (0)