From 5018bbb0c0c99aa53787ccfd4b20c620ccfd4e52 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 14 Oct 2015 20:21:38 +0200 Subject: [PATCH] correctly release messages created in test_merge_split --- src/kernel/messages.test.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/kernel/messages.test.c b/src/kernel/messages.test.c index e18dd54e8..fc6079dfe 100644 --- a/src/kernel/messages.test.c +++ b/src/kernel/messages.test.c @@ -41,11 +41,14 @@ static void test_merge_split(CuTest *tc) { message_list *mlist = 0, *append = 0; struct mlist **split; // TODO: why is this a double asterisk? message_type *mtype = mt_new("custom", NULL); + message *msg; test_cleanup(); mt_register(mtype); - add_message(&mlist, msg_message(mtype->name, "")); - add_message(&append, msg_message(mtype->name, "")); + add_message(&mlist, msg = msg_message(mtype->name, "")); + msg_release(msg); + add_message(&append, msg = msg_message(mtype->name, "")); + msg_release(msg); CuAssertPtrEquals(tc, 0, mlist->begin->next); CuAssertPtrEquals(tc, &mlist->begin->next, mlist->end);