From adrian at coresecurity.com Tue Feb 24 16:21:52 2009 From: adrian at coresecurity.com (Adrian Manrique) Date: Tue, 24 Feb 2009 13:21:52 -0200 Subject: [pyOpenSSL] potential memory leak Message-ID: <49A41090.3090803@coresecurity.com> I found a potential memory leak in flush_error_queue at util.c using Py_DECREF macro with a function call inside. Since macros expand its argument n times ( as Py_DECREF does, where n > 1 ) this call could be generated n times. In this case error_queue_to_list allocates a PyList object and transfer the ownership of the pointer to the caller function. Im attaching a simple patch cheers a/ -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: util.c.patch URL: