]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4844. [test] Address memory leaks in libatf-c. [RT #46798]
authorMark Andrews <marka@isc.org>
Fri, 8 Dec 2017 01:33:53 +0000 (12:33 +1100)
committerMark Andrews <marka@isc.org>
Fri, 8 Dec 2017 01:34:49 +0000 (12:34 +1100)
(cherry picked from commit 1c794002f5059945b83d54f19d19986d9bf34a35)

CHANGES
unit/atf-src/atf-c/detail/map.c
unit/atf-src/atf-c/detail/tp_main.c
unit/atf-src/atf-c/tc.c

diff --git a/CHANGES b/CHANGES
index cd93c54339620216656a53b9df7da25a22742f7f..c21dc3d9956d09fd68e1bb71b26ea736566f28eb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+4844.  [test]          Address memory leaks in libatf-c. [RT #46798]
+
 4843.  [bug]           dnssec-signzone free hashlist on exit. [RT #46791]
 
 4842.  [bug]           Conditionally compile opensslecdsa_link.c to avoid
index 7395adfebd9789b6a6c58595426c03b4bc2417c6..34025b2829f8e4fa6b94fe9a03ddeb32efc90e5c 100644 (file)
@@ -364,6 +364,7 @@ atf_map_insert(atf_map_t *m, const char *key, void *value, bool managed)
             if (atf_is_error(err)) {
                 if (managed)
                     free(value);
+                free(me->m_key);
                 free(me);
             }
         }
index a62ae0ad615bc79691e7b0ae570bcb17ea3aa3ef..1f1222de8652b2f34c759626d74196f66d8aa661 100644 (file)
@@ -285,6 +285,7 @@ list_tcs(const atf_tp_t *tp)
 
         atf_utils_free_charpp(vars);
     }
+    free(tcs);
 }
 
 /* ---------------------------------------------------------------------
index cbdd00c4e0b0f92414d638317aaaff0a56b89947..330ea0b924d7f68c43fb214185378294ee3619e0 100644 (file)
@@ -614,7 +614,9 @@ void
 atf_tc_fini(atf_tc_t *tc)
 {
     atf_map_fini(&tc->pimpl->m_vars);
+    atf_map_fini(&tc->pimpl->m_config);
     free(tc->pimpl);
+    tc->pimpl = NULL;
 }
 
 /*