diff options
| author | 童宗振 <[email protected]> | 2024-03-04 09:34:08 +0000 |
|---|---|---|
| committer | 童宗振 <[email protected]> | 2024-03-04 09:34:08 +0000 |
| commit | 73f19bf6b8c9a69706fd2687b6995b1ca7aaa047 (patch) | |
| tree | 2006397bda197f836d00ade4625c5fd0607e1320 /infra | |
| parent | 58c44000e308eddf416a2f3c6f4a88cdfc2a8b34 (diff) | |
fix(TSG-19753):The goto statement causes the free function to be called when memory is not allocated.
Diffstat (limited to 'infra')
| -rw-r--r-- | infra/src/dp_trace.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/infra/src/dp_trace.c b/infra/src/dp_trace.c index ac8a742..e37c4b2 100644 --- a/infra/src/dp_trace.c +++ b/infra/src/dp_trace.c @@ -195,7 +195,11 @@ void dp_trace_job_clean(struct dp_trace_job_ctx * ctx) return; ctx->pkt_cnt = 0; ctx->used = false; - FREE(ctx->fp.bf_insns); + if (ctx->fp.bf_insns != NULL) + { + FREE(ctx->fp.bf_insns); + ctx->fp.bf_insns = NULL; + } } int dp_trace_job_add(struct dp_trace_process * trace, const struct dp_trace_job_desc * desc, unsigned int job_index) |
