From: Pavel Filipenský Date: Wed, 11 Mar 2026 18:36:22 +0000 (+0100) Subject: util/tests: Extend the 'test_talloc_keep_secret' test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1d0449b147664c759fb3ebcb7fa94ff369cd9d3;p=thirdparty%2Fsamba.git util/tests: Extend the 'test_talloc_keep_secret' test Test that talloc_strdup() puts the secret as talloc name. Signed-off-by: Pavel Filipenský --- diff --git a/lib/util/tests/test_talloc_keep_secret.c b/lib/util/tests/test_talloc_keep_secret.c index 66c3f7f3e7a..78ef7619394 100644 --- a/lib/util/tests/test_talloc_keep_secret.c +++ b/lib/util/tests/test_talloc_keep_secret.c @@ -35,6 +35,13 @@ static void test_talloc_keep_secret(void ** state) assert_non_null(ptr1); assert_string_equal(ptr1, "secret"); + ptr1_talloc_name = talloc_get_name(ptr1); + assert_string_equal(ptr1_talloc_name, "secret"); + + /* + * talloc_keep_secret() changes the talloc name if the name reveals the + * memory content. + */ talloc_keep_secret(ptr1); ptr1_talloc_name = talloc_get_name(ptr1);