summaryrefslogtreecommitdiff
path: root/lib/talloc
diff options
context:
space:
mode:
authorSwen Schillig <swen@linux.ibm.com>2019-08-15 14:39:58 +0200
committerAndrew Bartlett <abartlet@samba.org>2019-08-21 07:20:39 +0000
commitd0933ec62c113a6da5209a556fad8819febe4ec2 (patch)
tree0cba7a0ceaaf4ffbd8a46c70af2ceb692a81039f /lib/talloc
parent6c3e8a0a9f0636467af5678c04d5aecc9c3dbf7a (diff)
downloadsamba-d0933ec62c113a6da5209a556fad8819febe4ec2.tar.gz
talloc: ASAN fix for test_rusty
Direct leak of 100 byte(s) in 1 object(s) allocated from: #0 0x7f06393dfc08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08) #1 0x7f06392d1af3 in __talloc_with_prefix ../../talloc.c:782 #2 0x7f06392d1af3 in __talloc ../../talloc.c:824 #3 0x7f06392d1af3 in __talloc_strlendup ../../talloc.c:2455 #4 0x7f06392d1af3 in talloc_strdup ../../talloc.c:2471 #5 0x40b4f0 in test_rusty ../../testsuite.c:1543 #6 0x40b4f0 in torture_local_talloc ../../testsuite.c:2146 #7 0x402603 in main ../../testsuite_main.c:32 #8 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>
Diffstat (limited to 'lib/talloc')
-rw-r--r--lib/talloc/testsuite.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c
index d936d18c2ae..ffede68f52a 100644
--- a/lib/talloc/testsuite.c
+++ b/lib/talloc/testsuite.c
@@ -1540,7 +1540,7 @@ static bool test_free_ref_null_context(void)
static bool test_rusty(void)
{
void *root;
- const char *p1;
+ char *p1;
talloc_enable_null_tracking();
root = talloc_new(NULL);
@@ -1549,6 +1549,8 @@ static bool test_rusty(void)
talloc_report_full(root, stdout);
talloc_free(root);
CHECK_BLOCKS("null_context", NULL, 2);
+ talloc_free(p1); /* make ASAN happy */
+
return true;
}