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);