git: b275a10c2b0e - main - net/openmdns: fix daemon memory leaks in various expected paths.

Alexey Dokuchaev danfe at FreeBSD.org
Tue Jul 13 10:20:19 UTC 2021


The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b275a10c2b0eb472235faf136a58f1a580578509

commit b275a10c2b0eb472235faf136a58f1a580578509
Author:     Alexey Dokuchaev <danfe at FreeBSD.org>
AuthorDate: 2021-07-13 10:19:12 +0000
Commit:     Alexey Dokuchaev <danfe at FreeBSD.org>
CommitDate: 2021-07-13 10:19:34 +0000

    net/openmdns: fix daemon memory leaks in various expected paths.
    
    PR:     249296
---
 net/openmdns/Makefile                 |  2 +-
 net/openmdns/files/patch-mdnsd_mdns.c | 30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

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 at 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));
+ }


More information about the dev-commits-ports-main mailing list