]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
bugfix #754: Memory leak in ldns_str2rdf_ipseckey
authorWillem Toorop <willem@nlnetlabs.nl>
Tue, 18 Oct 2016 09:51:47 +0000 (04:51 -0500)
committerWillem Toorop <willem@nlnetlabs.nl>
Tue, 18 Oct 2016 09:51:47 +0000 (04:51 -0500)
Changelog
host2str.c

index 62607016c436ba16748f1803d878a74eb85cc757..ec7b45e36ffb077d6032904b93d701ce82c52814 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -84,6 +84,8 @@ TBD
        * bugfix #760: Detect superfluous text in presentation format
          Thanks Xiali Yan
        * bugfix #708: warnings and errors with xcode 6.1/7.0
+       * bugfix #754: Memory leak in ldns_str2rdf_ipseckey
+         Thanks Xiali Yan
 
 1.6.17 2014-01-10
        * Fix ldns_dnssec_zone_new_frm_fp_l to allow the last parsed line of a
index 121558c11bba431ba132e2c02a99bb2a20a7bb00..04b9ddbb37f5ae3facd6acf283ce64205bd42bc4 100644 (file)
@@ -1134,7 +1134,7 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
        public_key_size = ldns_rdf_size(rdf) - offset;
        public_key_data = LDNS_XMALLOC(uint8_t, public_key_size);
         if(!public_key_data) {
-                ldns_rdf_free(gateway);
+                ldns_rdf_deep_free(gateway);
                 return LDNS_STATUS_MEM_ERR;
         }
        memcpy(public_key_data, &data[offset], public_key_size);
@@ -1142,7 +1142,7 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
                        public_key_size, public_key_data);
         if(!public_key) {
                 LDNS_FREE(public_key_data);
-                ldns_rdf_free(gateway);
+                ldns_rdf_deep_free(gateway);
                 return LDNS_STATUS_MEM_ERR;
         }
 
@@ -1154,8 +1154,8 @@ ldns_rdf2buffer_str_ipseckey(ldns_buffer *output, const ldns_rdf *rdf)
        ldns_buffer_printf(output, " ");
        (void) ldns_rdf2buffer_str(output, public_key);
 
-       ldns_rdf_free(gateway);
-       ldns_rdf_free(public_key);
+       ldns_rdf_deep_free(gateway);
+       ldns_rdf_deep_free(public_key);
 
        return ldns_buffer_status(output);
 }