[SSSD] [PATCH] sbus codegen tests: free ctx

Lukas Slebodnik lslebodn at redhat.com
Fri Oct 2 06:56:16 UTC 2015


On (01/10/15 14:36), Pavel Březina wrote:
>https://fedorahosted.org/sssd/ticket/2759

>From ad00807733ed3150d06615de035c6662af067673 Mon Sep 17 00:00:00 2001
>From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina at redhat.com>
>Date: Thu, 1 Oct 2015 14:34:51 +0200
>Subject: [PATCH] sbus codegen tests: free ctx
>
>Memory context was not freed therefore we got stuck in tevent loop
>that mocks D-Bus.
>
>Resolves:
>https://fedorahosted.org/sssd/ticket/2759
>---
> src/tests/sbus_codegen_tests.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/src/tests/sbus_codegen_tests.c b/src/tests/sbus_codegen_tests.c
>index 4637b92b84459041806bb5950e969e988716bec8..86424116bb01bb431137009a38416ce652001623 100644
>--- a/src/tests/sbus_codegen_tests.c
>+++ b/src/tests/sbus_codegen_tests.c
>@@ -1193,6 +1193,8 @@ START_TEST(test_get_array_dict_sas)
>         ck_assert_str_eq(value, exp_values[1]);
>         dbus_message_iter_next(&it_dict);
>     }
>+
>+    talloc_free(ctx);
> }
> END_TEST

BTW we had similar problem a year ago.

commit ba99aa00a305d298f65379e3add7536553c82455
Author: Pavel Březina <pbrezina at redhat.com>
Date:   Thu Jun 5 11:16:04 2014 +0200

    sbus_codegen_tests: free memory context

    The memory context was not freed and therefore a destructor that
    closes connection to D-Bus and performs cleanup task was not executed.

    Resolves:
    https://fedorahosted.org/sssd/ticket/2347


What we can do to prevent such mistakes in future?

LS


More information about the sssd-devel mailing list