Add a handler to avoid using invalid handle 50/129150/2
authorJunghoon Park <jh9216.park@samsung.com>
Mon, 15 May 2017 07:21:38 +0000 (16:21 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Mon, 15 May 2017 07:26:18 +0000 (16:26 +0900)
Change-Id: Ie59aa0ca3864c154b1a34a4381e27c63126cf21b
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
src/base/appcore_base.c

index ddc952b..47527a0 100644 (file)
@@ -1134,6 +1134,9 @@ EXPORT_API int appcore_base_remove_event(appcore_base_event_h handle)
        appcore_base_event_node *node = handle;
        enum appcore_base_event event;
 
+       if (!node || !g_list_find(__events, node))
+               return -1;
+
        event = node->type;
        __events = g_list_remove(__events, node);
        free(node);