fb engine : Add NULL type handling in output free.
authorSangHyeon Lee <sh10233.lee@samsung.com>
Mon, 22 Jun 2015 23:11:39 +0000 (08:11 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Mon, 22 Jun 2015 23:11:39 +0000 (08:11 +0900)
Summary:
Add NULL type check in output_free of evas fb engine.
If engine setup is failed,
Render_Engine wil be NULL so output_free also need to
handling NULL check.

Test Plan:
It needs specific condition to reproduce,
           engine of ecore_evas is set to fb, and setup is failed,
           then Render_Engine is NULL, but ecore_evas_free will call
           output_free in fb engine's evas_engine.c

Reviewers: raster, cedric, Hermet

Reviewed By: Hermet

Subscribers: cedric, seoz, eagleeye, singh.amitesh

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

src/modules/evas/engines/fb/evas_engine.c

index 21e124b..875cba4 100644 (file)
@@ -114,10 +114,11 @@ eng_output_free(void *data)
 {
    Render_Engine *re;
 
-   re = (Render_Engine *)data;
-
-   evas_render_engine_software_generic_clean(&re->generic);
-   free(re);
+   if (re = (Render_Engine *)data)
+     {
+        evas_render_engine_software_generic_clean(&re->generic);
+        free(re);
+     }
 
    evas_common_shutdown();
 }