[4.0] Fix Coverity issues 65/173765/2
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 21 Mar 2018 08:05:42 +0000 (17:05 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 26 Mar 2018 01:58:31 +0000 (10:58 +0900)
Change-Id: Ife7a74869c8114eba0d1aaa4670906843d9c7bdc
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
adaptors/ecore/wayland/window-impl-ecore-wl.cpp
adaptors/tizen/adaptor-impl-tizen.cpp

index 0e01ff2..97ee23e 100644 (file)
@@ -890,7 +890,7 @@ void Window::RemoveAvailableOrientation(Dali::Window::WindowOrientation orientat
 
 void Window::SetAvailableOrientations(const std::vector<Dali::Window::WindowOrientation>& orientations)
 {
-  int rotations[4];
+  int rotations[4] = { 0 };
   for( std::size_t i = 0; i < mAvailableOrientations.size(); ++i )
   {
     rotations[i] = static_cast< int >( mAvailableOrientations[i] );
index 5eea9a1..70754a9 100644 (file)
@@ -103,8 +103,13 @@ void Adaptor::SurfaceInitialized()
   char *appId;
   app_get_id(&appId);
 
-  Ecore_Wl_Window* ecoreWlWindow = AnyCast<Ecore_Wl_Window*>( mNativeWindow );
-  screen_connector_provider_remote_enable(appId, ecore_wl_window_surface_get(ecoreWlWindow));
+  // Use strdup() in app_get_id(), so need to free memory
+  if( appId )
+  {
+    Ecore_Wl_Window* ecoreWlWindow = AnyCast<Ecore_Wl_Window*>( mNativeWindow );
+    screen_connector_provider_remote_enable(appId, ecore_wl_window_surface_get(ecoreWlWindow));
+    free( appId );
+  }
 #endif
 }