aboutsummaryrefslogtreecommitdiff
path: root/net/openmdns/files/patch-mdnsd_mdns.c
blob: 319ad7069259cf6984ec6ab49be3b8ddad471a9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- mdnsd/mdns.c.orig	2017-03-10 09:24:12 UTC
+++ mdnsd/mdns.c
@@ -45,6 +45,9 @@ extern struct mdnsd_conf	*conf;
 struct question_tree		 question_tree;
 struct cache_tree		 cache_tree;
 
+pg_q pg_queue;
+pge_q pge_queue;
+
 /*
  * 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));
 }