diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-08-22 13:53:47 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2024-08-22 13:53:47 -0400 | 
| commit | 286e6f887128a8f9bb3addfb587d2e5b89ef892c (patch) | |
| tree | d9ac548b135bfbd57a0f16ea72c7e225c320b199 /lib | |
| parent | 4344ac1d288bc0834072261fcd7106391d505424 (diff) | |
lib: Ensure SA that root cannot be NULL
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/yang.c | 4 | 
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/yang.c b/lib/yang.c index 6a8e5223a0..6c1aed00cc 100644 --- a/lib/yang.c +++ b/lib/yang.c @@ -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);  | 
