42d74b
diff -up Python-2.7.3/Lib/test/test_hashlib.py.fix-hashlib-leak Python-2.7.3/Lib/test/test_hashlib.py
42d74b
--- Python-2.7.3/Lib/test/test_hashlib.py.fix-hashlib-leak	2013-02-19 14:13:44.000000000 -0500
42d74b
+++ Python-2.7.3/Lib/test/test_hashlib.py	2013-02-19 14:14:31.319948742 -0500
42d74b
@@ -106,12 +106,8 @@ class HashLibTestCase(unittest.TestCase)
5fd54b
                                                 _algo.islower()]))
5fd54b
 
5fd54b
     def test_unknown_hash(self):
5fd54b
-        try:
5fd54b
-            hashlib.new('spam spam spam spam spam')
5fd54b
-        except ValueError:
5fd54b
-            pass
5fd54b
-        else:
5fd54b
-            self.assertTrue(0 == "hashlib didn't reject bogus hash name")
5fd54b
+        self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
5fd54b
+        self.assertRaises(TypeError, hashlib.new, 1)
5fd54b
 
42d74b
     def test_hexdigest(self):
42d74b
         for name in self.supported_hash_names:
42d74b
diff -up Python-2.7.3/Modules/_hashopenssl.c.fix-hashlib-leak Python-2.7.3/Modules/_hashopenssl.c
42d74b
--- Python-2.7.3/Modules/_hashopenssl.c.fix-hashlib-leak	2013-02-19 14:13:44.646951933 -0500
42d74b
+++ Python-2.7.3/Modules/_hashopenssl.c	2013-02-19 14:13:44.715951929 -0500
42d74b
@@ -549,6 +549,7 @@ EVP_new(PyObject *self, PyObject *args,
5fd54b
     }
5fd54b
 
5fd54b
     if (!PyArg_Parse(name_obj, "s", &name)) {
5fd54b
+        PyBuffer_Release(&view);
5fd54b
         PyErr_SetString(PyExc_TypeError, "name must be a string");
5fd54b
         return NULL;
5fd54b
     }