Fix unhandled malloc errors 59/144159/3 submit/tizen/20170815.123151
authorDmitry Kovalenko <d.kovalenko@samsung.com>
Tue, 15 Aug 2017 08:28:31 +0000 (11:28 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Tue, 15 Aug 2017 11:51:12 +0000 (14:51 +0300)
Change-Id: Iffc98eb6c5e335b5a55eed22013a848891848d69
Signed-off-by: Dmitry Kovalenko <d.kovalenko@samsung.com>
probe_event/gesture.c
probe_thread/libdathread.c

index 8fff1aa..e8adfeb 100755 (executable)
@@ -232,6 +232,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 a7a667f..6cd4c3d 100644 (file)
@@ -82,6 +82,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;