Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r59390:774e6175005f
Date: 2012-12-10 20:58 +0100
http://bitbucket.org/pypy/pypy/changeset/774e6175005f/

Log:    Fix test... and plug a memory leak it discovered.

diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py
--- a/pypy/module/_ssl/interp_ssl.py
+++ b/pypy/module/_ssl/interp_ssl.py
@@ -444,6 +444,7 @@
                     space, w_socket, True)
             elif (err == SSL_ERROR_ZERO_RETURN and
                   libssl_SSL_get_shutdown(self.ssl) == SSL_RECEIVED_SHUTDOWN):
+                rffi.keep_buffer_alive_until_here(raw_buf, gc_buf)
                 if space.is_none(w_buf):
                     return space.wrapbytes('')
                 else:
diff --git a/pypy/module/_ssl/test/test_ssl.py 
b/pypy/module/_ssl/test/test_ssl.py
--- a/pypy/module/_ssl/test/test_ssl.py
+++ b/pypy/module/_ssl/test/test_ssl.py
@@ -129,6 +129,7 @@
         b = bytearray(8)
         read = ss.read(10, b)
         assert read == 8
+        discard = ss.read()
         read = ss.read(10, b)
         assert read == 0
         self.s.close()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to