[pypy-svn] pypy fast-forward: Fix memory leak in hashlib objects

amauryfa commits-noreply at bitbucket.org
Mon Jan 10 14:40:07 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: fast-forward
Changeset: r40553:363bbf15db52
Date: 2011-01-10 13:14 +0100
http://bitbucket.org/pypy/pypy/changeset/363bbf15db52/

Log:	Fix memory leak in hashlib objects

diff --git a/pypy/module/_hashlib/interp_hashlib.py b/pypy/module/_hashlib/interp_hashlib.py
--- a/pypy/module/_hashlib/interp_hashlib.py
+++ b/pypy/module/_hashlib/interp_hashlib.py
@@ -21,6 +21,9 @@
                                  space.wrap("unknown hash function"))
         ropenssl.EVP_DigestInit(self.ctx, digest)
 
+    def __del__(self):
+        lltype.free(self.ctx, flavor='raw')
+
     @unwrap_spec('self', ObjSpace)
     def descr_repr(self, space):
         addrstring = self.getaddrstring(space)


More information about the Pypy-commit mailing list