Fix issue detected by static analysis tool 92/125892/1
authorsungwook79.park <sungwook79.park@samsung.com>
Wed, 19 Apr 2017 08:26:47 +0000 (17:26 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Wed, 19 Apr 2017 08:26:47 +0000 (17:26 +0900)
Change-Id: Ib81d846a5e1123ee47aea30e336706b8fd455d82
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
src/event.cpp

index c467fb38bd0d813a58ee375aab9fdc1a4d446d42..99ba604f5ee6c05fe79d0a3aa5d2a7f006f36fdf 100755 (executable)
@@ -76,6 +76,7 @@ bool event_driven_thread::is_running()
 
 bool event_driven_thread::push_thread_event(int type, void* data)
 {
+       bool ret = false;
        if (g_atomic_int_get(&thread_info.is_running)) {
                event_message_s* event = new(std::nothrow) event_message_s;
                IF_FAIL_RETURN_TAG(event, false, _E, "Memory allocation failed");
@@ -83,12 +84,13 @@ bool event_driven_thread::push_thread_event(int type, void* data)
                event->type = type;
                event->data = data;
                g_async_queue_push(thread_info.event_queue, event);
-               return true;
+               ret = true;
        } else {
                // If failed, free the received data object & return false.
                delete_thread_event(type, data);
-               return false;
+               ret = false;
        }
+       return ret;
 }
 
 gpointer event_driven_thread::thread_func_wrapper(gpointer func)