From 0b5d5b40524ea6664f20caa876b94fa7522e7300 Mon Sep 17 00:00:00 2001 From: Jorge Pereira Date: Thu, 25 Jun 2015 17:52:29 -0300 Subject: [PATCH] Was leaking on cf_file_open() when don't have write permission --- src/main/conffile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/conffile.c b/src/main/conffile.c index 97da783563..235c456f87 100644 --- a/src/main/conffile.c +++ b/src/main/conffile.c @@ -333,9 +333,11 @@ static FILE *cf_file_open(CONF_SECTION *cs, char const *filename) if (stat(filename, &file->buf) < 0) { #ifdef S_IWOTH if ((file->buf.st_mode & S_IWOTH) != 0) { - fclose(fp); ERROR("Configuration file %s is globally writable. " "Refusing to start due to insecure configuration.", filename); + + fclose(fp); + talloc_free(file); return NULL; } #endif -- 2.47.2