main: check for parent->children before accessing it

this should not happen, but better be sure.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2021-06-21 15:11:25 +02:00
parent f41a872e0d
commit 12552f315f
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

2
main.c
View File

@ -944,7 +944,7 @@ node_free (void *p)
if (n->parent)
{
if (hash_lookup (n->parent->children, n) == n)
if (n->parent->children && hash_lookup (n->parent->children, n) == n)
hash_delete (n->parent->children, n);
n->parent->loaded = 0;
n->parent = NULL;