Merged revisions 83680,83685 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint

................
  r83680 | mark.dickinson | 2010-08-03 19:34:53 +0100 (Tue, 03 Aug 2010) | 9 lines

  Merged revisions 83677 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/branches/py3k

  ........
    r83677 | mark.dickinson | 2010-08-03 19:31:54 +0100 (Tue, 03 Aug 2010) | 1 line

    Fix memory leak in ssl module.
  ........
................
  r83685 | mark.dickinson | 2010-08-03 19:46:28 +0100 (Tue, 03 Aug 2010) | 9 lines

  Merged revisions 83683 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/branches/py3k

  ........
    r83683 | mark.dickinson | 2010-08-03 19:44:16 +0100 (Tue, 03 Aug 2010) | 1 line

    Misc/NEWS entry for r83677.
  ........
................
diff --git a/Misc/NEWS b/Misc/NEWS
index 77e1377..100854a 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -379,6 +379,8 @@
 Extension Modules
 -----------------
 
+- Fix memory leak in ssl._ssl._test_decode_cert.
+
 - Issue #9422: Fix memory leak when re-initializing a struct.Struct object.
 
 - Issue #7900: The getgroups(2) system call on MacOSX behaves rather oddly
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 6ed1a9f..4619cda 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -964,6 +964,7 @@
     }
 
     retval = _decode_certificate(x, verbose);
+    X509_free(x);
 
   fail0: