fix mem leak for ipport_plugin

This commit is contained in:
root
2024-10-18 08:32:15 +00:00
parent 041c32ccaa
commit 4fddb2b0e9

View File

@@ -150,6 +150,8 @@ struct ipport_matcher *ipport_matcher_new(struct ipport_rule *rules, size_t rule
return NULL; return NULL;
} }
FREE(ip_rules);
matcher->ip_matcher = ip_matcher; matcher->ip_matcher = ip_matcher;
return matcher; return matcher;
@@ -206,5 +208,10 @@ void ipport_matcher_free(struct ipport_matcher *matcher)
FREE(node); FREE(node);
} }
if (matcher->ip_matcher != NULL) {
ip_matcher_free(matcher->ip_matcher);
matcher->ip_matcher = NULL;
}
FREE(matcher); FREE(matcher);
} }