From 3dc7d0e39d17780de3c6156a93c836c2f21e93ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 1 Jan 2019 23:24:27 +0100 Subject: [PATCH] yml: yml_destroy(): return immediately if node is NULL This can happen for example when destroying a partially created dictionary entry, where only the key node has been created. --- yml.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yml.c b/yml.c index b8f2db7..27e1c5c 100644 --- a/yml.c +++ b/yml.c @@ -365,6 +365,9 @@ yml_load(FILE *yml) void yml_destroy(struct yml_node *node) { + if (node == NULL) + return; + switch (node->type) { case ROOT: yml_destroy(node->root.root);