talloc: ASAN fix for test_magic_protection
authorSwen Schillig <swen@linux.ibm.com>
Thu, 15 Aug 2019 12:43:22 +0000 (14:43 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 21 Aug 2019 07:20:39 +0000 (07:20 +0000)
Direct leak of 1152 byte(s) in 1 object(s) allocated from:
     #0 0x7f06393dfc08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
     #1 0x7f06392cfd59 in __talloc_with_prefix ../../talloc.c:782
     #2 0x7f06392cfd59 in _talloc_pool ../../talloc.c:837
     #3 0x7f06392cfd59 in talloc_pool ../../talloc.c:859
     #4 0x40b83c in test_magic_protection ../../testsuite.c:1960
     #5 0x40b83c in torture_local_talloc ../../testsuite.c:2164
     #6 0x402603 in main ../../testsuite_main.c:32
     #7 0x7f063908a412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
lib/talloc/testsuite.c

index ffede68f52a1d3ffb535ea7bab2825483ec2b470..aa5c771ea31e524c93fd42d97304b025f172b684 100644 (file)
@@ -1999,6 +1999,8 @@ static bool test_magic_protection(void)
 
        while (wait(&exit_status) != pid);
 
+       talloc_free(pool); /* make ASAN happy */
+
        if (!WIFEXITED(exit_status)) {
                printf("Child exited through unexpected abnormal means\n");
                return false;