From b62da2cbcc6b84ad7c07e213a21aab8656b3b2aa Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Thu, 1 Oct 2020 23:36:56 +0500 Subject: [PATCH] channels/disp/client/disp_main.c: fix possible null pointer dereference found by cppcheck channels/disp/client/disp_main.c:340:7: warning: Either the condition 'if(disp&&disp->listener_callback)' is redundant or there is possible null pointer dereference: disp. [nullPointerRedundantCheck] --- channels/disp/client/disp_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/disp/client/disp_main.c b/channels/disp/client/disp_main.c index d718958a1..156451270 100644 --- a/channels/disp/client/disp_main.c +++ b/channels/disp/client/disp_main.c @@ -335,9 +335,9 @@ static UINT disp_plugin_terminated(IWTSPlugin* pPlugin) IWTSVirtualChannelManager* mgr = disp->listener_callback->channel_mgr; if (mgr) IFCALL(mgr->DestroyListener, mgr, disp->listener); + free(disp->listener_callback); } - free(disp->listener_callback); free(disp->iface.pInterface); free(pPlugin); return CHANNEL_RC_OK;