Skip to content

Commit 30e0c36

Browse files
committed
sigsegv after cli_free_command
1 parent dcfd3b7 commit 30e0c36

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: libcli.c

+3
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,9 @@ static void cli_free_command(struct cli_def *cli, struct cli_command *cmd) {
486486
if (cmd->next) {
487487
cmd->next->previous = cmd->previous;
488488
}
489+
if (cmd->parent && cmd == cmd->parent->children) {
490+
cmd->parent->children = cmd->next;
491+
}
489492
}
490493
free(cmd);
491494
}

0 commit comments

Comments
 (0)