From 2cc56f7dd5e54a48b874a23237c8019aa7705d00 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Mon, 4 Jan 2016 11:56:53 +0100 Subject: [PATCH] Fix code analysis. --- src/Components/Modules/IPCPipe.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Components/Modules/IPCPipe.cpp b/src/Components/Modules/IPCPipe.cpp index 92465873..67dabd40 100644 --- a/src/Components/Modules/IPCPipe.cpp +++ b/src/Components/Modules/IPCPipe.cpp @@ -102,7 +102,7 @@ namespace Components //*this->PipeFile = 0; //*this->PipeName = 0; - if (INVALID_HANDLE_VALUE != this->hPipe) + if (this->hPipe && INVALID_HANDLE_VALUE != this->hPipe) { if (this->mType == IPCTYPE_SERVER) DisconnectNamedPipe(this->hPipe); @@ -137,7 +137,7 @@ namespace Components void Pipe::ReceiveThread(Pipe* pipe) { - if (!pipe || pipe->mType != IPCTYPE_SERVER || pipe->hPipe == INVALID_HANDLE_VALUE) return; + if (!pipe || pipe->mType != IPCTYPE_SERVER || pipe->hPipe == INVALID_HANDLE_VALUE || !pipe->hPipe) return; if (ConnectNamedPipe(pipe->hPipe, NULL) == FALSE) { @@ -150,7 +150,7 @@ namespace Components DWORD cbBytes; - while (pipe->mThreadAttached && pipe->hPipe != INVALID_HANDLE_VALUE) + while (pipe->mThreadAttached && pipe->hPipe && pipe->hPipe != INVALID_HANDLE_VALUE) { BOOL bResult = ReadFile(pipe->hPipe, &pipe->mPacket, sizeof(pipe->mPacket), &cbBytes, NULL);