From: Mark Andrews Date: Fri, 8 Dec 2017 01:33:53 +0000 (+1100) Subject: 4844. [test] Address memory leaks in libatf-c. [RT #46798] X-Git-Tag: v9.12.1b1~174 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=1c794002f5059945b83d54f19d19986d9bf34a35;p=thirdparty%2Fbind9.git 4844. [test] Address memory leaks in libatf-c. [RT #46798] --- diff --git a/CHANGES b/CHANGES index 935376f6a1f..3b04bffb3dc 100644 --- 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 diff --git a/unit/atf-src/atf-c/detail/map.c b/unit/atf-src/atf-c/detail/map.c index 7395adfebd9..34025b2829f 100644 --- a/unit/atf-src/atf-c/detail/map.c +++ b/unit/atf-src/atf-c/detail/map.c @@ -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); } } diff --git a/unit/atf-src/atf-c/detail/tp_main.c b/unit/atf-src/atf-c/detail/tp_main.c index a62ae0ad615..1f1222de865 100644 --- a/unit/atf-src/atf-c/detail/tp_main.c +++ b/unit/atf-src/atf-c/detail/tp_main.c @@ -285,6 +285,7 @@ list_tcs(const atf_tp_t *tp) atf_utils_free_charpp(vars); } + free(tcs); } /* --------------------------------------------------------------------- diff --git a/unit/atf-src/atf-c/tc.c b/unit/atf-src/atf-c/tc.c index cbdd00c4e0b..330ea0b924d 100644 --- a/unit/atf-src/atf-c/tc.c +++ b/unit/atf-src/atf-c/tc.c @@ -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; } /*