From 7d0585cc8da8d319e8d6c8f95283e575ffc398aa Mon Sep 17 00:00:00 2001 From: Dimitar Krastev Date: Fri, 24 May 2024 11:53:02 +0300 Subject: [PATCH 1/2] Fixed win32 handle leak. Terminate Process does not close the handle. --- Tests/Pcap++Test/Tests/LiveDeviceTests.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/Pcap++Test/Tests/LiveDeviceTests.cpp b/Tests/Pcap++Test/Tests/LiveDeviceTests.cpp index b8c72d2c6b..65376e36f5 100644 --- a/Tests/Pcap++Test/Tests/LiveDeviceTests.cpp +++ b/Tests/Pcap++Test/Tests/LiveDeviceTests.cpp @@ -140,6 +140,7 @@ class RpcapdServerInitializer if (m_ProcessHandle != NULL) { TerminateProcess(m_ProcessHandle, 0); + CloseHandle(m_ProcessHandle); } } From 408e23492e2ca218af19329d2420cb985e024c2f Mon Sep 17 00:00:00 2001 From: Dimitar Krastev Date: Fri, 24 May 2024 11:53:37 +0300 Subject: [PATCH 2/2] c cast -> cpp cast --- Tests/Pcap++Test/Tests/LiveDeviceTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Pcap++Test/Tests/LiveDeviceTests.cpp b/Tests/Pcap++Test/Tests/LiveDeviceTests.cpp index 65376e36f5..c6d4e910ca 100644 --- a/Tests/Pcap++Test/Tests/LiveDeviceTests.cpp +++ b/Tests/Pcap++Test/Tests/LiveDeviceTests.cpp @@ -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(GetLastError())); return; }