Skip to content

Commit

Permalink
Merge pull request #851 from Marsman1996/master
Browse files Browse the repository at this point in the history
dlt_jnpr_ether_cleanup: check config before cleanup
  • Loading branch information
fklassen authored Jun 3, 2024
2 parents a7aab40 + 62bc10d commit b002ccc
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 b002ccc

Please sign in to comment.