diff --git a/server/modules/filter/dbfwfilter.c b/server/modules/filter/dbfwfilter.c index 75bf81273..c8efd7e36 100644 --- a/server/modules/filter/dbfwfilter.c +++ b/server/modules/filter/dbfwfilter.c @@ -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; }