From bfcf3b4679f0a246e009c76a0c966fdcdcdd97b0 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Wed, 13 Mar 2019 14:37:58 +0500 Subject: [PATCH] main.c: resolve possible null pointer dereference found by cppcheck [main.c:457] -> [main.c:457]: (warning) Either the condition 'copy_data->dwData==(WM_APP+15)&&c->hwndStatus&&c' is redundant or there is possible null pointer dereference: c. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index ff91b4f..6a56d7c 100644 --- a/main.c +++ b/main.c @@ -454,7 +454,7 @@ HandleCopyDataMessage(const COPYDATASTRUCT *copy_data) ForceForegroundWindow(o.hWnd); RestartOpenVPN(c); } - else if(copy_data->dwData == WM_OVPN_SHOWSTATUS && c->hwndStatus && c) + else if(copy_data->dwData == WM_OVPN_SHOWSTATUS && c && c->hwndStatus) { ForceForegroundWindow(o.hWnd); ShowWindow(c->hwndStatus, SW_SHOW);