tests: Call res_nclose() in test_res_query_search.c.
authorJakub Hrozek <jakub.hrozek@gmail.com>
Tue, 21 Oct 2014 13:27:54 +0000 (15:27 +0200)
committerAndreas Schneider <asn@samba.org>
Thu, 23 Oct 2014 12:13:26 +0000 (14:13 +0200)
The res_query and res_nsearch unit tests didn't call res_nclose as
appropriate, leading to a resource leak.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
tests/test_res_query_search.c

index 2188f76..cfc933a 100644 (file)
@@ -93,6 +93,8 @@ static void test_res_query(void **state)
        assert_int_equal(ns_rr_type(rr), ns_t_a);
        assert_non_null(inet_ntop(AF_INET, ns_rr_rdata(rr), addr, 256));
        assert_string_equal(addr, "127.0.10.10");
+
+       res_nclose(&dnsstate);
 }
 
 static void test_res_search(void **state)
@@ -125,6 +127,8 @@ static void test_res_search(void **state)
        assert_int_equal(ns_rr_type(rr), ns_t_a);
        assert_non_null(inet_ntop(AF_INET, ns_rr_rdata(rr), addr, 256));
        assert_string_equal(addr, "127.0.10.10");
+
+       res_nclose(&dnsstate);
 }
 
 int main(void)