|
|
ced1f5 |
From d624420972d061f72b08727bd7b2e227ce047272 Mon Sep 17 00:00:00 2001
|
|
|
ced1f5 |
From: Lukas Slebodnik <lslebodn@redhat.com>
|
|
|
ced1f5 |
Date: Tue, 28 Nov 2017 12:20:26 +0100
|
|
|
ced1f5 |
Subject: [PATCH 61/67] test_responder: Check memory leak in sized_output_name
|
|
|
ced1f5 |
MIME-Version: 1.0
|
|
|
ced1f5 |
Content-Type: text/plain; charset=UTF-8
|
|
|
ced1f5 |
Content-Transfer-Encoding: 8bit
|
|
|
ced1f5 |
|
|
|
ced1f5 |
Resolves:
|
|
|
ced1f5 |
https://pagure.io/SSSD/sssd/issue/3588
|
|
|
ced1f5 |
|
|
|
ced1f5 |
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
|
|
|
ced1f5 |
(cherry picked from commit 051e0fc7cc86fb4e4b3a9323a61684ad3a6fa589)
|
|
|
ced1f5 |
---
|
|
|
ced1f5 |
src/tests/cmocka/test_responder_common.c | 20 ++++++++++++++++++++
|
|
|
ced1f5 |
1 file changed, 20 insertions(+)
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/tests/cmocka/test_responder_common.c b/src/tests/cmocka/test_responder_common.c
|
|
|
ced1f5 |
index fb7e4ee500570319999e6e85ee14a05cddea8de3..5441167caeb284982ee76926117da029966ec997 100644
|
|
|
ced1f5 |
--- a/src/tests/cmocka/test_responder_common.c
|
|
|
ced1f5 |
+++ b/src/tests/cmocka/test_responder_common.c
|
|
|
ced1f5 |
@@ -316,6 +316,23 @@ void test_schedule_get_domains_task(void **state)
|
|
|
ced1f5 |
talloc_free(dummy_ncache_ptr);
|
|
|
ced1f5 |
}
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+void test_sss_output_fqname(void **state)
|
|
|
ced1f5 |
+{
|
|
|
ced1f5 |
+ struct parse_inp_test_ctx *parse_inp_ctx = talloc_get_type(*state,
|
|
|
ced1f5 |
+ struct parse_inp_test_ctx);
|
|
|
ced1f5 |
+ errno_t ret;
|
|
|
ced1f5 |
+ struct sized_string *res = NULL;
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ ret = sized_output_name(parse_inp_ctx, parse_inp_ctx->rctx, "dummy",
|
|
|
ced1f5 |
+ parse_inp_ctx->tctx->dom, &res;;
|
|
|
ced1f5 |
+ assert_int_equal(ret, EOK);
|
|
|
ced1f5 |
+ assert_non_null(res);
|
|
|
ced1f5 |
+ assert_string_equal("dummy", res->str);
|
|
|
ced1f5 |
+ assert_int_equal(6, res->len);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ talloc_zfree(res);
|
|
|
ced1f5 |
+}
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
int main(int argc, const char *argv[])
|
|
|
ced1f5 |
{
|
|
|
ced1f5 |
int rv;
|
|
|
ced1f5 |
@@ -346,6 +363,9 @@ int main(int argc, const char *argv[])
|
|
|
ced1f5 |
cmocka_unit_test_setup_teardown(test_schedule_get_domains_task,
|
|
|
ced1f5 |
parse_inp_test_setup,
|
|
|
ced1f5 |
parse_inp_test_teardown),
|
|
|
ced1f5 |
+ cmocka_unit_test_setup_teardown(test_sss_output_fqname,
|
|
|
ced1f5 |
+ parse_inp_test_setup,
|
|
|
ced1f5 |
+ parse_inp_test_teardown),
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
/* Set debug level to invalid value so we can deside if -d 0 was used. */
|
|
|
ced1f5 |
--
|
|
|
ced1f5 |
2.14.3
|
|
|
ced1f5 |
|