configfile.c: Fixed a memory leak in cf_read_generic().
authorSebastian Harl <sh@tokkee.org>
Thu, 20 Mar 2008 10:01:18 +0000 (11:01 +0100)
committerFlorian Forster <octo@huhu.verplant.org>
Sat, 22 Mar 2008 08:31:08 +0000 (09:31 +0100)
In case stat(2) failed, the memory allocated for the return value has not
been freed.

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/configfile.c

index 18c82d9..ef997fa 100644 (file)
@@ -617,6 +617,7 @@ static oconfig_item_t *cf_read_generic (const char *path, int depth)
                        ERROR ("configfile: stat (%s) failed: %s",
                                        path_ptr,
                                        sstrerror (errno, errbuf, sizeof (errbuf)));
+                       oconfig_free (root);
                        return (NULL);
                }