xref: /OK3568_Linux_fs/buildroot/package/python-pam/0001-dealloc.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1[PATCH] fix two bugs in the PAM object deallocation
2
3Fixes https://bugzilla.redhat.com/show_bug.cgi?id=658955
4
5Downloaded from:
6http://pkgs.fedoraproject.org/cgit/PyPAM.git/plain/PyPAM-0.5.0-dealloc.patch
7
8Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
9diff -up PyPAM-0.5.0/PAMmodule.c.dealloc PyPAM-0.5.0/PAMmodule.c
10--- PyPAM-0.5.0/PAMmodule.c.dealloc	2011-01-17 22:48:22.000000000 +0100
11+++ PyPAM-0.5.0/PAMmodule.c	2011-01-18 21:24:59.000000000 +0100
12@@ -538,10 +538,11 @@ static void PyPAM_dealloc(PyPAMObject *s
13     free(self->service);
14     free(self->user);
15     free(self->conv);
16-    pam_end(self->pamh, PAM_SUCCESS);
17+    if (self->pamh)
18+        pam_end(self->pamh, PAM_SUCCESS);
19     dlclose(self->dlh2);
20     dlclose(self->dlh1);
21-    PyMem_DEL(self);
22+    PyObject_Del(self);
23 }
24
25 static PyObject * PyPAM_getattr(PyPAMObject *self, char *name)
26