[Vm-dev] Memory leak in the SqueakSSL plugin on unix

Levente Uzonyi leves at elte.hu
Thu Oct 17 18:02:04 UTC 2013

Seems like the end of the message got lost. So here's the full message 


we've been experiencing memory leakage in long running Squeak images using 
SqueakSSL. After a bit of monitoring I found that 132 bytes get leaked
for each https request done from the image. After a bit of code review, 
I've probably found the culprit, and another potential source of memory
leak. For the reference, the source file this mail is about is

The main memory leak is in sqDestroySSL function (starting on line 117), 
which doesn't free the bioRead and bioWrite variables (allocated by
sqCreateSSL on line 98-99) of the ssl object. My suggested solution is to 
insert the following two lines before line 132:


The other potential source of memory leak is sqSetStringPropertySSL 
(starting on line 381). It allocates a chunk of memory on line 389, but
doesn't use nor free it, if the propID argument is not 
SQSSL_PROP_CERTNAME. My suggested solution is to insert the following line 
after line 396:

         if(property) free(property);

Note that I haven't tested any of these, but I hope someone who is more 
into VM building right now will try them.


More information about the Vm-dev mailing list