Fix 'dereferenced after NULL' issues 57/54857/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 18 Dec 2015 07:56:14 +0000 (16:56 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 18 Dec 2015 07:56:35 +0000 (16:56 +0900)
After having been compared to NULL value,
Some pointer values are dereferenced.

Change-Id: Iea5805157d1fd49d68e6a732f70efe088dcf783a

scl/sclgwes.cpp

index c4d1d44..00b352c 100644 (file)
@@ -45,15 +45,21 @@ void CSCLGwes::init(sclwindow parent, scl16 width, scl16 height)
     if (m_windows) {
         m_windows->init();
     }
+
     if (m_graphics) {
         m_graphics->init();
     }
+
     if (m_events) {
         m_events->init();
     }
 
-    sclwindow wnd = m_windows->create_base_window(parent, width, height);
-    m_events->connect_window_events(wnd, SCL_EVENT_MOUSE | SCL_EVENT_EXPOSE);
+    if (m_windows) {
+        sclwindow wnd = m_windows->create_base_window(parent, width, height);
+        if (m_events) {
+            m_events->connect_window_events(wnd, SCL_EVENT_MOUSE | SCL_EVENT_EXPOSE);
+        }
+    }
 }
 
 void CSCLGwes::fini()