From e831aad6d48874abab6efa37d4460da2be3ac765 Mon Sep 17 00:00:00 2001 From: Marsman1996 <lqliuyuwei@outlook.com> Date: Wed, 1 Mar 2023 14:48:48 +0800 Subject: [PATCH] dlt_jnpr_ether_cleanup: check subctx before cleanup --- src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c b/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c index e282ef48..98b67e9c 100644 --- a/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c +++ b/src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c @@ -168,7 +168,8 @@ dlt_jnpr_ether_cleanup(tcpeditdlt_t *ctx) jnpr_ether_config_t *config; config = (jnpr_ether_config_t *)ctx->encoder->config; - tcpedit_dlt_cleanup(config->subctx); + if (config->subctx != NULL) + tcpedit_dlt_cleanup(config->subctx); safe_free(plugin->config); plugin->config = NULL; plugin->config_size = 0;