diff --git a/scanner/ipport_matcher/ipport_matcher.c b/scanner/ipport_matcher/ipport_matcher.c index 4cad90b..a4ddb18 100644 --- a/scanner/ipport_matcher/ipport_matcher.c +++ b/scanner/ipport_matcher/ipport_matcher.c @@ -150,6 +150,8 @@ struct ipport_matcher *ipport_matcher_new(struct ipport_rule *rules, size_t rule return NULL; } + FREE(ip_rules); + matcher->ip_matcher = ip_matcher; return matcher; @@ -206,5 +208,10 @@ void ipport_matcher_free(struct ipport_matcher *matcher) FREE(node); } + if (matcher->ip_matcher != NULL) { + ip_matcher_free(matcher->ip_matcher); + matcher->ip_matcher = NULL; + } + FREE(matcher); } \ No newline at end of file