--- a/src/configfile.c 2014-05-13 18:26:54.078179163 +0200 +++ b/src/configfile.c 2014-05-13 18:28:50.227802938 +0200 @@ -459,6 +459,12 @@ static int cf_ci_append_children (oconfi { oconfig_item_t *temp; + if (dst == NULL) + { + ERROR ("configfile: destination is null."); + return (-1); + } + if ((src == NULL) || (src->children_num == 0)) return (0); @@ -720,6 +726,7 @@ static oconfig_item_t *cf_read_generic ( if (temp == NULL) { oconfig_free (root); + free (root); return (NULL); } @@ -730,9 +737,10 @@ static oconfig_item_t *cf_read_generic ( wordfree (&we); - if (root->children == NULL) + if (root && root->children == NULL) { oconfig_free (root); + free (root); return (NULL); } @@ -938,6 +938,7 @@ int cf_read (char *filename) } oconfig_free (conf); + free (conf); /* Read the default types.db if no `TypesDB' option was given. */ if (cf_default_typesdb)