diff --git a/daemon/control_tcp.c b/daemon/control_tcp.c index d4295cf43..73aa3cfa4 100644 --- a/daemon/control_tcp.c +++ b/daemon/control_tcp.c @@ -67,6 +67,7 @@ static int control_stream_parse(struct streambuf_stream *s, char *line) { 0, 0, md, NULL); if (ret <= 0) { ilogs(control, LOG_WARNING, "Unable to parse command line from %s: %s", s->addr, line); + pcre2_match_data_free(md); return -1; } diff --git a/daemon/control_udp.c b/daemon/control_udp.c index d227c43e1..8164cea62 100644 --- a/daemon/control_udp.c +++ b/daemon/control_udp.c @@ -35,6 +35,7 @@ static void control_udp_incoming(struct obj *obj, struct udp_buffer *udp_buf) { ret = pcre2_match(u->fallback_re, (PCRE2_SPTR8) udp_buf->str.s, udp_buf->str.len, 0, 0, md, NULL); if (ret <= 0) { ilogs(control, LOG_WARNING, "Unable to parse command line from udp:%s: %.*s", udp_buf->addr, STR_FMT(&udp_buf->str)); + pcre2_match_data_free(md); return; }