From: Sebastian Harl Date: Thu, 20 Mar 2008 10:01:18 +0000 (+0100) Subject: configfile.c: Fixed a memory leak in cf_read_generic(). X-Git-Tag: collectd-4.3.2~14 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cef357b350d0f866ab1c9772b16c0680fb361f18;p=collectd.git configfile.c: Fixed a memory leak in cf_read_generic(). In case stat(2) failed, the memory allocated for the return value has not been freed. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/configfile.c b/src/configfile.c index 18c82d94..ef997fac 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -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); }