ecore_evas: fix a potentional deref after null problem 98/199898/1
authorWonki Kim <wonki_.kim@samsung.com>
Wed, 13 Feb 2019 15:42:24 +0000 (10:42 -0500)
committerWonki Kim <wonki_.kim@samsung.com>
Fri, 15 Feb 2019 08:51:24 +0000 (17:51 +0900)
Summary:
this patch modify a logic to return after,
failing to call eore_evas_buffer_allocfunc_new function.

Reviewers: Hermet, bu5hm4n, cedric, devilhorns

Reviewed By: devilhorns

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7918

Change-Id: I7a7d294b7fc023de052d03dcd7bc3ccf2e917c8a

src/lib/ecore_evas/ecore_evas_buffer.c

index 9672230..a20f115 100644 (file)
@@ -900,7 +900,11 @@ ecore_evas_buffer_new(int w, int h)
      ecore_evas_buffer_allocfunc_new(w, h, _ecore_evas_buffer_pix_alloc,
                                      _ecore_evas_buffer_pix_free, NULL);
 
-   if (!ee) ecore_event_evas_shutdown();
+   if (!ee)
+     {
+        ecore_event_evas_shutdown();
+        return NULL;
+     }
 
    ecore_evas_done(ee, EINA_TRUE);