Correctly handle extension initialization errors
diff --git a/ChangeLog b/ChangeLog
index a2085a4..77ba64a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-27 Jean-Paul Calderone <exarkun@twistedmatrix.com>
+
+ * src/crypto/x509ext.c: Correctly deallocate the new Extension
+ instance when there is an error initializing it and it is not
+ going to be returned. Resolves LP#368043.
+
2009-05-11 Jean-Paul Calderone <exarkun@twistedmatrix.com>
* test/test_crypto.py: Use binary mode for the pipe to talk to the
diff --git a/src/crypto/x509ext.c b/src/crypto/x509ext.c
index 3b3c814..84df441 100644
--- a/src/crypto/x509ext.c
+++ b/src/crypto/x509ext.c
@@ -133,7 +133,7 @@
exception_from_error_queue();
critical_malloc_error:
- PyObject_Free(self);
+ Py_XDECREF(self);
error:
return NULL;