Skip to content

Commit

Permalink
allow recursice call to tcpedit_dlt_cleanup()
Browse files Browse the repository at this point in the history
This is just a quick hack to prevent a double-free should
tcpedit_dlt_cleanup() call itself, which can hapen through dlt_jnpr_ether_cleanup()

Ref: appneta#813
  • Loading branch information
GabrielGanne committed Jan 28, 2024
1 parent 43693c4 commit 55ad9d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 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,10 @@ 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->subctx != NULL) {
ctx->decoded_extra = NULL;
tcpedit_dlt_cleanup(config->subctx);
}
safe_free(plugin->config);
plugin->config = NULL;
plugin->config_size = 0;
Expand Down

0 comments on commit 55ad9d1

Please sign in to comment.