From: Seoyeon Kim Date: Wed, 21 Mar 2018 08:05:42 +0000 (+0900) Subject: [4.0] Fix Coverity issues X-Git-Tag: accepted/tizen/4.0/unified/20180327.144913~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=4a014cd851e4128f8efadcc3cf3aa77fda82bcc6;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [4.0] Fix Coverity issues Change-Id: Ife7a74869c8114eba0d1aaa4670906843d9c7bdc Signed-off-by: Seoyeon Kim --- diff --git a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp index 0e01ff2..97ee23e 100644 --- a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp +++ b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp @@ -890,7 +890,7 @@ void Window::RemoveAvailableOrientation(Dali::Window::WindowOrientation orientat void Window::SetAvailableOrientations(const std::vector& 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] ); diff --git a/adaptors/tizen/adaptor-impl-tizen.cpp b/adaptors/tizen/adaptor-impl-tizen.cpp index 5eea9a1..70754a9 100644 --- a/adaptors/tizen/adaptor-impl-tizen.cpp +++ b/adaptors/tizen/adaptor-impl-tizen.cpp @@ -103,8 +103,13 @@ void Adaptor::SurfaceInitialized() char *appId; app_get_id(&appId); - Ecore_Wl_Window* ecoreWlWindow = AnyCast( 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( mNativeWindow ); + screen_connector_provider_remote_enable(appId, ecore_wl_window_surface_get(ecoreWlWindow)); + free( appId ); + } #endif }