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 4a468ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ 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)

Check warning on line 167 in src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c

View workflow job for this annotation

GitHub Actions / cpp-linter

src/tcpedit/plugins/dlt_jnpr_ether/jnpr_ether.c:167:54 [readability-braces-around-statements]

statement should be inside braces
tcpedit_dlt_cleanup(config->subctx);
safe_free(plugin->config);
plugin->config = NULL;
Expand Down

0 comments on commit 4a468ab

Please sign in to comment.