main: fix read after free

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2019-07-25 15:21:31 +02:00
parent 79c802f61e
commit 7e54c97400
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

2
main.c
View File

@ -1241,9 +1241,9 @@ insert_node (struct ovl_node *parent, struct ovl_node *item, bool replace)
old = hash_delete (parent->children, item);
if (old)
{
node_free (old);
if (node_dirp (old))
parent->nlinks--;
node_free (old);
}
}