From: Jorge Pereira Date: Thu, 25 Jun 2015 20:52:29 +0000 (-0300) Subject: Was leaking on cf_file_open() when don't have write permission X-Git-Tag: release_3_0_9~79^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1070%2Fhead;p=thirdparty%2Ffreeradius-server.git Was leaking on cf_file_open() when don't have write permission --- 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