index 2bb80cc99a864b6112dd065048221310b8ca3211..db9285b3cf47052581405dcfce2d69170d0c587f 100644 (file)
--- a/src/liboconfig/oconfig.c
+++ b/src/liboconfig/oconfig.c
{
int i;
+ if (ci == NULL)
+ return;
+
+ if (ci->key != NULL)
+ free (ci->key);
+
+ for (i = 0; i < ci->values_num; i++)
+ if ((ci->values[i].type == OCONFIG_TYPE_STRING)
+ && (NULL != ci->values[i].value.string))
+ free (ci->values[i].value.string);
+
if (ci->values != NULL)
free (ci->values);
for (i = 0; i < ci->children_num; i++)
oconfig_free (ci->children + i);
+
+ if (ci->children != NULL)
+ free (ci->children);
}
/*