Skip to content

Commit

Permalink
Fix memory allocation bug.
Browse files Browse the repository at this point in the history
Co-authored-by: Peter van der Perk <[email protected]>

Signed-off-by: Benjamin Perseghetti <[email protected]>
  • Loading branch information
bperseghetti committed Apr 10, 2024
1 parent 29a78d0 commit 575a1b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion port/platform/zephyr/src/u_port_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ int32_t MTX_FN(uPortMutexCreate(uPortMutexHandle_t *pMutexHandle))
if (pMutexHandle != NULL) {
errorCode = U_ERROR_COMMON_NO_MEMORY;
// Actually create the mutex
*pMutexHandle = (uPortMutexHandle_t) k_malloc(sizeof(struct k_mutex));
*pMutexHandle = (uPortMutexHandle_t) k_malloc(sizeof(struct k_mutex) + 44);
if (*pMutexHandle != NULL) {
errorCode = U_ERROR_COMMON_PLATFORM;
if (0 == k_mutex_init((struct k_mutex *) * pMutexHandle)) {
Expand Down

0 comments on commit 575a1b6

Please sign in to comment.