Blame SOURCES/PyPAM-0.5.0-dealloc.patch

154a42
diff -up PyPAM-0.5.0/PAMmodule.c.dealloc PyPAM-0.5.0/PAMmodule.c
154a42
--- PyPAM-0.5.0/PAMmodule.c.dealloc	2011-01-17 22:48:22.000000000 +0100
154a42
+++ PyPAM-0.5.0/PAMmodule.c	2011-01-18 21:24:59.000000000 +0100
154a42
@@ -538,10 +538,11 @@ static void PyPAM_dealloc(PyPAMObject *s
154a42
     free(self->service);
154a42
     free(self->user);
154a42
     free(self->conv);
154a42
-    pam_end(self->pamh, PAM_SUCCESS);
154a42
+    if (self->pamh)
154a42
+        pam_end(self->pamh, PAM_SUCCESS);
154a42
     dlclose(self->dlh2);
154a42
     dlclose(self->dlh1);
154a42
-    PyMem_DEL(self);
154a42
+    PyObject_Del(self);
154a42
 }
154a42
 
154a42
 static PyObject * PyPAM_getattr(PyPAMObject *self, char *name)