mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-02 20:27:14 +00:00
lib: Ensure SA that root cannot be NULL
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
4344ac1d28
commit
286e6f8871
@ -1398,8 +1398,10 @@ LY_ERR yang_lyd_trim_xpath(struct lyd_node **root, const char *xpath)
|
||||
}
|
||||
}
|
||||
darr_foreach_i (remove, i) {
|
||||
if (remove[i] == *root)
|
||||
if (remove[i] == *root) {
|
||||
assert(*root);
|
||||
*root = (*root)->next;
|
||||
}
|
||||
lyd_free_tree(remove[i]);
|
||||
}
|
||||
darr_free(remove);
|
||||
|
Loading…
Reference in New Issue
Block a user