Skip to content

Commit

Permalink
Fix #435, correct init in PCS_malloc call
Browse files Browse the repository at this point in the history
The handler executes after the stub count increments, thus this
needs to check for 1 to indicate the first call, not 0.
  • Loading branch information
jphickey committed Sep 12, 2024
1 parent fb6c855 commit 2336dde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unit-test-coverage/ut-stubs/src/PCS_stdlib_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2336dde

Please sign in to comment.