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.
pull/299/head
Ilya Shipitsin 2019-03-13 14:37:58 +05:00 committed by Selva Nair
parent fc3d96bd73
commit bfcf3b4679
1 changed files with 1 additions and 1 deletions

2
main.c
View File

@ -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);