From 9c485ed5ab663b96cae6199498356fd13ee35904 Mon Sep 17 00:00:00 2001 From: Benjamin Perseghetti Date: Tue, 9 Apr 2024 22:45:17 -0400 Subject: [PATCH] Fix memory allocation bug. Co-authored-by: Peter van der Perk Signed-off-by: Benjamin Perseghetti --- port/platform/zephyr/src/u_port_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/port/platform/zephyr/src/u_port_os.c b/port/platform/zephyr/src/u_port_os.c index dbd83f4e..f6d49617 100644 --- a/port/platform/zephyr/src/u_port_os.c +++ b/port/platform/zephyr/src/u_port_os.c @@ -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)) {