forked from external/yambar
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.
This commit is contained in:
parent
a9110cc936
commit
3dc7d0e39d
1 changed files with 3 additions and 0 deletions
3
yml.c
3
yml.c
|
@ -365,6 +365,9 @@ yml_load(FILE *yml)
|
||||||
void
|
void
|
||||||
yml_destroy(struct yml_node *node)
|
yml_destroy(struct yml_node *node)
|
||||||
{
|
{
|
||||||
|
if (node == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
switch (node->type) {
|
switch (node->type) {
|
||||||
case ROOT:
|
case ROOT:
|
||||||
yml_destroy(node->root.root);
|
yml_destroy(node->root.root);
|
||||||
|
|
Loading…
Add table
Reference in a new issue