diff --git a/src/system/emscripten/system.c b/src/system/emscripten/system.c index 9bfa8f7d6..52065d2db 100644 --- a/src/system/emscripten/system.c +++ b/src/system/emscripten/system.c @@ -55,11 +55,7 @@ z_result_t _z_task_detach(_z_task_t *task) { _Z_CHECK_SYS_ERR(pthread_detach(*ta z_result_t _z_task_cancel(_z_task_t *task) { _Z_CHECK_SYS_ERR(pthread_cancel(*task)); } -void _z_task_free(_z_task_t **task) { - _z_task_t *ptr = *task; - z_free(ptr); - *task = NULL; -} +void _z_task_free(_z_task_t **task) { *task = NULL; } /*------------------ Mutex ------------------*/ z_result_t _z_mutex_init(_z_mutex_t *m) { _Z_CHECK_SYS_ERR(pthread_mutex_init(m, 0)); } diff --git a/src/system/unix/system.c b/src/system/unix/system.c index beb78ceef..d1c0c5886 100644 --- a/src/system/unix/system.c +++ b/src/system/unix/system.c @@ -114,11 +114,7 @@ z_result_t _z_task_detach(_z_task_t *task) { _Z_CHECK_SYS_ERR(pthread_detach(*ta z_result_t _z_task_cancel(_z_task_t *task) { _Z_CHECK_SYS_ERR(pthread_cancel(*task)); } -void _z_task_free(_z_task_t **task) { - _z_task_t *ptr = *task; - z_free(ptr); - *task = NULL; -} +void _z_task_free(_z_task_t **task) { *task = NULL; } /*------------------ Mutex ------------------*/ z_result_t _z_mutex_init(_z_mutex_t *m) { _Z_CHECK_SYS_ERR(pthread_mutex_init(m, 0)); } diff --git a/src/system/zephyr/system.c b/src/system/zephyr/system.c index c76e26a02..7818c9993 100644 --- a/src/system/zephyr/system.c +++ b/src/system/zephyr/system.c @@ -89,11 +89,7 @@ z_result_t _z_task_detach(_z_task_t *task) { _Z_CHECK_SYS_ERR(pthread_detach(*ta z_result_t _z_task_cancel(_z_task_t *task) { _Z_CHECK_SYS_ERR(pthread_cancel(*task)); } -void _z_task_free(_z_task_t **task) { - _z_task_t *ptr = *task; - z_free(ptr); - *task = NULL; -} +void _z_task_free(_z_task_t **task) { *task = NULL; } /*------------------ Mutex ------------------*/ z_result_t _z_mutex_init(_z_mutex_t *m) { _Z_CHECK_SYS_ERR(pthread_mutex_init(m, 0)); }