Fix Coverity issues 02/173402/2
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 21 Mar 2018 08:05:42 +0000 (17:05 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Thu, 22 Mar 2018 04:27:13 +0000 (13:27 +0900)
Change-Id: Ife7a74869c8114eba0d1aaa4670906843d9c7bdc
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
dali/internal/adaptor/tizen/adaptor-impl-tizen.cpp
dali/internal/window-system/tizen-wayland/window-impl-ecore-wl.cpp

index a685636..1dfd267 100644 (file)
@@ -101,10 +101,17 @@ void Adaptor::SurfaceInitialized()
     return;
   }
   char *appId;
-  app_get_id(&appId);
+  char *id;
+  app_get_id(&id);
 
-  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( id )
+  {
+    appId = id;
+    Ecore_Wl_Window* ecoreWlWindow = AnyCast<Ecore_Wl_Window*>( mNativeWindow );
+    screen_connector_provider_remote_enable(appId, ecore_wl_window_surface_get(ecoreWlWindow));
+    free( id );
+  }
 #endif
 }
 
index c2b45f5..fbcd0c6 100644 (file)
@@ -884,7 +884,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] );