Whamcloud - gitweb
LU-10901 build: Update ZFS/SPL to 0.7.8
[fs/lustre-release.git] / lnet / utils / lnetconfig / cyaml.c
index 7c0ae4e..71b3f49 100644 (file)
@@ -679,13 +679,15 @@ static bool clean_usr_data(struct cYAML *node, void *usr_data, void **out)
 
 static bool free_node(struct cYAML *node, void *user_data, void **out)
 {
+       if (!node)
+               return true;
+
        if (node->cy_type == CYAML_TYPE_STRING)
                free(node->cy_valuestring);
        if (node->cy_string)
                free(node->cy_string);
-       if (node)
-               free(node);
 
+       free(node);
        return true;
 }