From 0fe8b5ccdd2633328312eeae6ce2c022001961e9 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 1 Apr 2021 16:24:03 +0900 Subject: [PATCH] Add missing line to return NULL when alloc failed. Change-Id: Ifa88e7a36fd19c144d50c9cec7604541d6aabf24 Signed-off-by: Joonbum Ko --- src/tpl_utils_gthread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tpl_utils_gthread.c b/src/tpl_utils_gthread.c index 47a7041..41c5101 100644 --- a/src/tpl_utils_gthread.c +++ b/src/tpl_utils_gthread.c @@ -77,6 +77,8 @@ tpl_gthread_create(const char *thread_name, TPL_ERR("Failed to allocate tpl_gthread"); g_main_context_unref(context); g_main_loop_unref(loop); + + return NULL; } g_mutex_init(&new_thread->thread_mutex); @@ -86,7 +88,6 @@ tpl_gthread_create(const char *thread_name, g_mutex_lock(&new_thread->thread_mutex); new_thread->loop = loop; - TPL_DEBUG("loop(%p)", loop); new_thread->init_func = init_func; new_thread->func_data = func_data; new_thread->thread = g_thread_new(thread_name, -- 2.7.4