aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2021-07-13 10:19:12 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2021-07-13 10:19:34 +0000
commitb275a10c2b0eb472235faf136a58f1a580578509 (patch)
tree4116c948994cbfe967a1b7421fc9bc65a665c182
parentcaaa5b3265d68ae7a4fc96212f0c4d9200d3f4ea (diff)
downloadports-b275a10c2b0eb472235faf136a58f1a580578509.tar.gz
ports-b275a10c2b0eb472235faf136a58f1a580578509.zip
net/openmdns: fix daemon memory leaks in various expected paths.
PR: 249296
-rw-r--r--net/openmdns/Makefile2
-rw-r--r--net/openmdns/files/patch-mdnsd_mdns.c30
2 files changed, 31 insertions, 1 deletions
diff --git a/net/openmdns/Makefile b/net/openmdns/Makefile
index 2134d392129f..95dd599faef2 100644
--- a/net/openmdns/Makefile
+++ b/net/openmdns/Makefile
@@ -1,6 +1,6 @@
PORTNAME= openmdns
DISTVERSION= 0.7
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net
MAINTAINER= ports@FreeBSD.org
diff --git a/net/openmdns/files/patch-mdnsd_mdns.c b/net/openmdns/files/patch-mdnsd_mdns.c
index 51033c03b314..319ad7069259 100644
--- a/net/openmdns/files/patch-mdnsd_mdns.c
+++ b/net/openmdns/files/patch-mdnsd_mdns.c
@@ -10,3 +10,33 @@
/*
* RR cache
*/
+@@ -155,8 +158,10 @@ cache_process(struct rr *rr)
+ /* TODO Cancel possible deletion */
+ log_warnx("cache_process: recover %s",
+ rrs_str(&rr->rrs));
++ free(rr);
+ return (0);
+ }
++ free(rr);
+ return (0);
+ }
+ /*
+@@ -186,14 +191,17 @@ cache_process(struct rr *rr)
+ rr_aux->ttl = rr->ttl;
+ rr_aux->revision = 0;
+ cache_schedrev(rr_aux);
++ free(rr);
+
+ return (0);
+ }
+ }
+ }
+ /* Got a goodbye for a record we don't have */
+- if (rr->ttl == 0)
++ if (rr->ttl == 0) {
++ free(rr);
+ return (0);
++ }
+
+ return (cache_insert(rr));
+ }