Fixed a possible memory leak in dbfwfilter.

This commit is contained in:
Markus Makela
2015-03-30 07:33:24 +03:00
parent 0b7e1d5a51
commit 875e49c074

View File

@ -802,6 +802,23 @@ bool link_rules(char* orig, FW_INSTANCE* instance)
return rval;
}
/**
* Free a TIMERANGE struct
* @param tr pointer to a TIMERANGE struct
*/
void tr_free(TIMERANGE* tr)
{
TIMERANGE *node,*tmp;
node = tr;
while(node)
{
tmp = node;
node = node->next;
free(tmp);
}
}
/**
* Parse the configuration value either as a new rule or a list of users.
* @param rule The string to parse
@ -937,6 +954,7 @@ bool parse_rule(char* rule, FW_INSTANCE* instance)
{
skygw_log_write(LOGFILE_ERROR,"dbfwfilter: Rule parsing failed, unexpected characters after time definition.");
rval = false;
tr_free(tr);
goto retblock;
}