Options and hooks updates.

This commit is contained in:
Nicholas Marriott
2026-06-30 17:57:38 +01:00
parent c92720e3b0
commit b3bb8bbd9f
8 changed files with 53 additions and 102 deletions

View File

@@ -791,12 +791,10 @@ cmd_parse_add_ref(struct cmd_parse_tree *tree)
void
cmd_parse_free(struct cmd_parse_tree *tree)
{
if (tree == NULL)
return;
if (--tree->references != 0)
return;
cmd_parse_free_node(tree->root);
free(tree);
if (tree != NULL && --tree->references == 0) {
cmd_parse_free_node(tree->root);
free(tree);
}
}
struct cmd_parse_node *