From 2336ddee131d8d1c40c65989bc317d7a7e2c2486 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Thu, 12 Sep 2024 16:32:17 -0400 Subject: [PATCH] Fix #435, correct init in PCS_malloc call The handler executes after the stub count increments, thus this needs to check for 1 to indicate the first call, not 0. --- unit-test-coverage/ut-stubs/src/PCS_stdlib_handlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit-test-coverage/ut-stubs/src/PCS_stdlib_handlers.c b/unit-test-coverage/ut-stubs/src/PCS_stdlib_handlers.c index 381b0b4b..7a166ff9 100644 --- a/unit-test-coverage/ut-stubs/src/PCS_stdlib_handlers.c +++ b/unit-test-coverage/ut-stubs/src/PCS_stdlib_handlers.c @@ -94,7 +94,7 @@ void UT_DefaultHandler_PCS_malloc(void *UserObj, UT_EntryKey_t FuncKey, const UT Rec = (struct MPOOL_REC *)PoolStart; NextBlock = PoolStart + MPOOL_ALIGN; PoolSize -= MPOOL_ALIGN; - if (CallCnt == 0) + if (CallCnt == 1) { Rec->Magic = MPOOL_START_SIGNATURE; Rec->Size = 0;