fix svace issues
[platform/core/messaging/email-service.git] / email-daemon / email-daemon-mail.c
index 175e421..d4dce4d 100755 (executable)
@@ -731,7 +731,8 @@ FINISH_OFF:
        thread_func_event_data->multi_user_name = g_strdup(multi_user_name);
 
        THREAD_CREATE(delete_thread, thread_func_to_delete_mail, (void *)thread_func_event_data, thread_error);
-       THREAD_DETACH(delete_thread); /* free resources used for new thread */
+       if (thread_error == 0)
+               THREAD_DETACH(delete_thread); /* free resources used for new thread */
        ret = true;
 
 FINISH_OFF2:
@@ -1090,7 +1091,8 @@ FINISH_OFF:
        thread_func_event_data->multi_user_name = g_strdup(multi_user_name);
 
        THREAD_CREATE(move_thread, thread_func_to_move_mail, (void*)thread_func_event_data, thread_error);
-       THREAD_DETACH(move_thread); /* free resources used for new thread */
+       if (thread_error == 0)
+               THREAD_DETACH(move_thread); /* free resources used for new thread */
        EM_DEBUG_LOG("thread_error [%d]", thread_error);
        ret = true;
 
@@ -1267,7 +1269,8 @@ FINISH_OFF:
        thread_func_event_data->multi_user_name = g_strdup(multi_user_name);
 
        THREAD_CREATE(move_thread, thread_func_to_move_mail, (void*)thread_func_event_data, thread_error);
-       THREAD_DETACH(move_thread); /* free resources used for new thread */
+       if (thread_error == 0)
+               THREAD_DETACH(move_thread); /* free resources used for new thread */
        EM_DEBUG_LOG("thread_error [%d]", thread_error);
        ret = true;