Unverified Commit f2dbf772 authored by honfika's avatar honfika Committed by GitHub

Merge pull request #414 from antrv/feature/fix-getprocessid

Fix releasing memory in GetProcessIdByLocalPort
parents 89b47360 3ea7f568
......@@ -37,11 +37,10 @@ namespace Titanium.Web.Proxy.Helpers
0) == 0)
{
int rowCount = *(int*)tcpTable;
tcpTable += 4; // int size
if (ipVersion == IpVersion.Ipv4)
{
NativeMethods.TcpRow* rowPtr = (NativeMethods.TcpRow*)tcpTable;
NativeMethods.TcpRow* rowPtr = (NativeMethods.TcpRow*)(tcpTable + 4);
for (int i = 0; i < rowCount; ++i)
{
......@@ -55,7 +54,7 @@ namespace Titanium.Web.Proxy.Helpers
}
else
{
NativeMethods.Tcp6Row* rowPtr = (NativeMethods.Tcp6Row*)tcpTable;
NativeMethods.Tcp6Row* rowPtr = (NativeMethods.Tcp6Row*)(tcpTable + 4);
for (int i = 0; i < rowCount; ++i)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment