Skip to content

Commit

Permalink
dlt_jnpr_ether_cleanup: check config before cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Marsman1996 committed Apr 2, 2024
1 parent 43693c4 commit 62bc10d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ dlt_jnpr_ether_cleanup(tcpeditdlt_t *ctx)
jnpr_ether_config_t *config;

config = (jnpr_ether_config_t *)ctx->encoder->config;
if (config->subctx != NULL)
if (config != NULL && config->subctx != NULL) {
tcpedit_dlt_cleanup(config->subctx);
}
safe_free(plugin->config);
plugin->config = NULL;
plugin->config_size = 0;
Expand Down

0 comments on commit 62bc10d

Please sign in to comment.