Skip to content

Commit

Permalink
free hostByName struct - fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
bebbo committed Mar 24, 2024
1 parent 0501e6e commit c4154e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions amitools/vamos/lib/BsdSocketLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from amitools.vamos.astructs.string import CSTR
from amitools.vamos.astructs.pointer import APTR_VOID
from amitools.vamos.astructs.scalar import LONG, UBYTE, UWORD, ULONG
from amitools.vamos.astructs.access import AccessStruct
from sys import byteorder

class BsdSocketLibrary(LibImpl):

Expand All @@ -28,6 +26,9 @@ def open_lib(self, ctx, open_cnt):
self.cnt = open_cnt

def close_lib(self, ctx, open_cnt):
if self.hostByName != None:
self.hostByName.free()
self.hostByName = None
self.cnt = open_cnt

def get_version(self):
Expand Down

0 comments on commit c4154e3

Please sign in to comment.