check before dereference.
authorAlan T. DeKok <aland@freeradius.org>
Fri, 26 May 2017 14:52:20 +0000 (10:52 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 26 May 2017 14:52:20 +0000 (10:52 -0400)
Found by PVS-Studio

src/main/conffile.c

index 10c029a..5f4c722 100644 (file)
@@ -1393,10 +1393,12 @@ int cf_item_parse(CONF_SECTION *cs, char const *name, unsigned int type, void *d
        CONF_PAIR *cp = NULL;
        fr_ipaddr_t *ipaddr;
        char buffer[8192];
-       CONF_ITEM *c_item = &cs->item;
+       CONF_ITEM *c_item;
 
        if (!cs) return -1;
 
+       c_item = &cs->item;
+
        deprecated = (type & PW_TYPE_DEPRECATED);
        required = (type & PW_TYPE_REQUIRED);
        attribute = (type & PW_TYPE_ATTRIBUTE);