Menu

#2 Memory leak

open
nobody
None
5
2008-01-12
2008-01-12
Anonymous
No

Hi,

A memory leak occur each time the "GetProcessHeap" is call in modNet.bas

This can be solved by clearing the allocated memory with "Private Declare Function HeapFree Lib "kernel32" (ByVal hHeap As Long, ByVal dwFlags As Long, lpMem As Any) As Long"

In "Public Sub CheckApplications()" add :

Dim mheap As Long
...
'For TCP
mheap = GetProcessHeap()
lReturn = AllocateAndGetTcpExTableFromStack(lAddr, True, mheap, 2, 2)

After the TCP Loop :
...
Next
'Get out from my memory !
HeapFree mheap, 0, ByVal lAddr
End If
'For UDP
...

Same thing for the UDP loop part.

At the end of the function comment :
' WTSFreeMemory lAddr

'---------

[voices in my mind]
For more memory and cpu optimization why not considering merging the checkTCP and CheckApplications functions or merging the infos displayed by these functions ? (There is redundant/same infos in the display of both parts)

Also, for feature request the possibility to set allowed/denied ports/port range/... for each detected apps.
A "Allow once" button in the alert popup (allow a app to access network temporary.
And ... hum ... no, i stop here ! (for now) ouch ! :)
[/voices in my mind]

Nevertheless, it's good work, keep it up !

Thanks,
-Sept

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.