]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
* Fix memory leak in examples/ldns-testns handle_tcp routine.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 18 Nov 2019 10:21:13 +0000 (11:21 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Mon, 18 Nov 2019 10:21:13 +0000 (11:21 +0100)
Changelog
examples/ldns-testpkts.c

index 546a4e04dd2580e95bfbabe493d085549d41e9d2..86d8f91c65ef9a89441dffcf28d88a571b3a4028 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -3,6 +3,7 @@
          rr_frm_str_internal reported by pokerfacett.
        * bugfix #51: Heap Out-of-bound Read vulnerability in
          ldns_nsec3_salt_data reported by pokerfacett.
+       * Fix memory leak in examples/ldns-testns handle_tcp routine.
 
 1.7.1  2019-07-26
        * bugfix: Manage verification paths for OpenSSL >= 1.1.0
index c67541d0b1c04f9063894c2f395a0b771dd389f9..05a54c583888aa5d65b4becc96b0484336a88862 100644 (file)
@@ -834,7 +834,7 @@ handle_query(uint8_t* inbuf, ssize_t inlen, struct entry* entries, int* count,
        status = ldns_wire2pkt(&query_pkt, inbuf, (size_t)inlen);
        if (status != LDNS_STATUS_OK) {
                verbose(1, "Got bad packet: %s\n", ldns_get_errorstr_by_id(status));
-               ldns_rdf_free(stop_command);
+               ldns_rdf_deep_free(stop_command);
                return;
        }
        
@@ -855,7 +855,7 @@ handle_query(uint8_t* inbuf, ssize_t inlen, struct entry* entries, int* count,
        if(!entry || !entry->reply_list) {
                verbose(1, "no answer packet for this query, no reply.\n");
                ldns_pkt_free(query_pkt);
-               ldns_rdf_free(stop_command);
+               ldns_rdf_deep_free(stop_command);
                return;
        }
        for(p = entry->reply_list; p; p = p->next)
@@ -874,7 +874,7 @@ handle_query(uint8_t* inbuf, ssize_t inlen, struct entry* entries, int* count,
                                if (status != LDNS_STATUS_OK) {
                                        verbose(1, "Error creating answer: %s\n", ldns_get_errorstr_by_id(status));
                                        ldns_pkt_free(query_pkt);
-                                       ldns_rdf_free(stop_command);
+                                       ldns_rdf_deep_free(stop_command);
                                        return;
                                }
                                ldns_pkt_free(answer_pkt);
@@ -899,7 +899,7 @@ handle_query(uint8_t* inbuf, ssize_t inlen, struct entry* entries, int* count,
                        if (status != LDNS_STATUS_OK) {
                                verbose(1, "Error creating answer: %s\n", ldns_get_errorstr_by_id(status));
                                ldns_pkt_free(query_pkt);
-                               ldns_rdf_free(stop_command);
+                               ldns_rdf_deep_free(stop_command);
                                return;
                        }
                        ldns_pkt_free(answer_pkt);
@@ -922,7 +922,7 @@ handle_query(uint8_t* inbuf, ssize_t inlen, struct entry* entries, int* count,
                answer_size = 0;
        }
        ldns_pkt_free(query_pkt);
-       ldns_rdf_free(stop_command);
+       ldns_rdf_deep_free(stop_command);
 }
 
 /** delete the list of reply packets */