[ldns-users] [PATCH 2/2] ldns_wire2pkt: fix memory leak with more EDNS sections

Jan Vcelak jv at fcelda.cz
Tue Apr 4 14:28:56 UTC 2017


---
 wire2host.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/wire2host.c b/wire2host.c
index 0788e7bc..a30e89e7 100644
--- a/wire2host.c
+++ b/wire2host.c
@@ -468,6 +468,7 @@ ldns_wire2pkt(ldns_pkt **packet_p, const uint8_t *wire, size_t max)
 			ldns_pkt_set_edns_z(packet, ldns_read_uint16(&data[2]));
 			/* edns might not have rdfs */
 			if (ldns_rr_rdf(rr, 0)) {
+				ldns_rdf_deep_free(ldns_pkt_edns_data(packet));
 				ldns_pkt_set_edns_data(packet, ldns_rdf_clone(ldns_rr_rdf(rr, 0)));
 			}
 			ldns_rr_free(rr);
-- 
2.12.2




More information about the ldns-users mailing list