Fixed a possible memory leak in dbfwfilter.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user