avoid null deref in sx_radix_node_freeall

Fixes segfault if querying an AS with no route objects (e.g 65000).
This commit is contained in:
Stuart Henderson
2019-12-30 11:35:04 +00:00
committed by GitHub
parent 7fa7e76d8e
commit bda0408c9e

View File

@@ -23,7 +23,9 @@ void sx_radix_node_freeall(struct sx_radix_node *n) {
}
void sx_radix_tree_freeall(struct sx_radix_tree *t) {
sx_radix_node_freeall(t->head);
if (t->head != NULL) {
sx_radix_node_freeall(t->head);
}
free(t);
}