]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Was leaking on cf_file_open() when don't have write permission 1070/head
authorJorge Pereira <jpereiran@gmail.com>
Thu, 25 Jun 2015 20:52:29 +0000 (17:52 -0300)
committerJorge Pereira <jpereiran@gmail.com>
Thu, 25 Jun 2015 20:52:29 +0000 (17:52 -0300)
src/main/conffile.c

index 97da783563b3f9d70865c4d7b6aa698d5253326a..235c456f8785c02c4e254080fd5070d3e95af59d 100644 (file)
@@ -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