Fix unhandled malloc errors 60/144160/3 accepted/tizen_3.0_common accepted/tizen_3.0_mobile accepted/tizen_3.0_tv accepted/tizen_3.0_wearable tizen_3.0_210817 accepted/tizen/3.0/common/20170816.145024 accepted/tizen/3.0/mobile/20170816.130951 accepted/tizen/3.0/tv/20170816.131004 accepted/tizen/3.0/wearable/20170816.131014 submit/tizen_3.0/20170815.122716 submit/tizen_3.0/20170815.122854 submit/tizen_3.0/20170815.123042
authorDmitry Kovalenko <d.kovalenko@samsung.com>
Tue, 15 Aug 2017 08:38:29 +0000 (11:38 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Tue, 15 Aug 2017 11:55:24 +0000 (14:55 +0300)
Change-Id: Ifc62e7746b0646d60537a76ba86a34df35a14aac
Signed-off-by: Dmitry Kovalenko <d.kovalenko@samsung.com>
probe_event/gesture.c
probe_thread/libdathread.c

index f941c84..fdb4ddd 100755 (executable)
@@ -237,6 +237,10 @@ void PROBE_NAME(elm_gesture_layer_cb_set)(Evas_Object *obj, Elm_Gesture_Type idx
 
        /* TODO Free memory on cb remove */
        elm = malloc(sizeof(*elm));
+       if (!elm) {
+               PRINTERR("Can't allocate memory for elm");
+               return;
+       }
 
        elm->obj = obj;
        elm->idx = idx;
index 62ac59f..c8c8b8e 100644 (file)
@@ -81,6 +81,11 @@ HANDLER_WRAPPERS(thread_feature, int, pthread_create, pthread_t *, thread,
        {
                thread_routine_call *ptrc =
                        (thread_routine_call *)malloc(sizeof(thread_routine_call));
+               if (!ptrc) {
+                       PRINTERR("Can't allocate memory for ptrc");
+                       return EAGAIN;
+               }
+
                ptrc->thread_routine = start_routine;
                ptrc->argument = arg;