From 4a014cd851e4128f8efadcc3cf3aa77fda82bcc6 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 21 Mar 2018 17:05:42 +0900 Subject: [PATCH] [4.0] Fix Coverity issues Change-Id: Ife7a74869c8114eba0d1aaa4670906843d9c7bdc Signed-off-by: Seoyeon Kim --- adaptors/ecore/wayland/window-impl-ecore-wl.cpp | 2 +- adaptors/tizen/adaptor-impl-tizen.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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 } -- 2.7.4