nitialize data pointer before setting it
authorAlan T. DeKok <aland@freeradius.org>
Mon, 28 Nov 2011 12:36:22 +0000 (13:36 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 28 Nov 2011 12:37:27 +0000 (13:37 +0100)
So that if there's an error setting it, we can free it without
the system blowing up.

Closes Debian bug #606450

src/main/conffile.c

index e206da1..29ad97b 100644 (file)
@@ -1144,6 +1144,11 @@ int cf_section_parse(CONF_SECTION *cs, void *base,
                        goto error;
                }
 
+               if ((variables[i].type == PW_TYPE_STRING_PTR) ||
+                   (variables[i].type == PW_TYPE_FILENAME)) {
+                       *(char **) data = NULL;
+               }
+
                /*
                 *      Parse the pair we found, or a default value.
                 */