From 7daf1d9ebe753631b98b4c241b0a1c9c5226fcd3 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 6 Jul 2016 13:15:56 +0900 Subject: [PATCH] Fix Svace issue - Return value of 'wl_resource_create' function is dereferenced at line 290 Change-Id: Iaf60d5caca318ed0d994cf95af1efdad1a8569aa --- pepper-dali/internal/shell-client-impl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pepper-dali/internal/shell-client-impl.cpp b/pepper-dali/internal/shell-client-impl.cpp index f57ee5a..8531355 100644 --- a/pepper-dali/internal/shell-client-impl.cpp +++ b/pepper-dali/internal/shell-client-impl.cpp @@ -271,6 +271,11 @@ void ShellClient::GetSurface( wl_client* client, unsigned int id, wl_resource* s mSurface = static_cast< pepper_surface_t* >( wl_resource_get_user_data( surfaceResource ) ); mSurfaceResource = wl_resource_create( client, &xdg_surface_interface, 1, id ); + if( !mSurfaceResource ) + { + DALI_LOG_INFO( gPepperShellClientLogging, Debug::General, "ShellClient::GetSurface: wl_resource_create is failed\n" ); + return; + } mView = pepper_compositor_add_view( static_cast< pepper_compositor_t* >( Pepper::GetImplementation( mCompositor ).GetCompositorHandle() ) ); if( !mView ) -- 2.7.4