Skip to content

Commit

Permalink
Fixed leaked win32 handle during testing. (#1405)
Browse files Browse the repository at this point in the history
* Fixed win32 handle leak. Terminate Process does not close the handle.

* c cast -> cpp cast
  • Loading branch information
Dimi1010 authored May 25, 2024
1 parent 91497be commit 3297db8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Tests/Pcap++Test/Tests/LiveDeviceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class RpcapdServerInitializer
)
{
m_ProcessHandle = NULL;
PCPP_LOG_ERROR("Create process failed " << (int)GetLastError());
PCPP_LOG_ERROR("Create process failed " << static_cast<int>(GetLastError()));
return;
}

Expand All @@ -140,6 +140,7 @@ class RpcapdServerInitializer
if (m_ProcessHandle != NULL)
{
TerminateProcess(m_ProcessHandle, 0);
CloseHandle(m_ProcessHandle);
}
}

Expand Down

0 comments on commit 3297db8

Please sign in to comment.