Skip to content

Commit

Permalink
Don't return pointer out of scope.
Browse files Browse the repository at this point in the history
Fixes CID #1197126
  • Loading branch information
alandekok committed Apr 7, 2014
1 parent cb52897 commit 1eb058a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/main/conffile.c
Expand Up @@ -901,6 +901,7 @@ int cf_item_parse(CONF_SECTION *cs, char const *name, int type, void *data, char
fr_ipaddr_t ipaddr;
CONF_PAIR const *cp = NULL;
char ipbuf[128];
char buffer[8192];

if (!cs) return -1;

Expand Down Expand Up @@ -987,15 +988,10 @@ int cf_item_parse(CONF_SECTION *cs, char const *name, int type, void *data, char
* file was read.
*/
if (value == dflt) {
char buffer[8192];

int lineno = 0;

lineno = cs->item.lineno;

/*
* FIXME: sizeof(buffer)?
*/
value = cf_expand_variables("<internal>",
&lineno,
cs, buffer, sizeof(buffer),
Expand Down Expand Up @@ -1052,13 +1048,8 @@ int cf_item_parse(CONF_SECTION *cs, char const *name, int type, void *data, char
* file was read.
*/
if ((value == dflt) && cs) {
char buffer[8192];

int lineno = 0;

/*
* FIXME: sizeof(buffer)?
*/
value = cf_expand_variables("?",
&lineno,
cs, buffer, sizeof(buffer),
Expand Down

0 comments on commit 1eb058a

Please sign in to comment.