sysklogd: fix build on musl
[buildroot-gz.git] / package / python-pam / 0001-dealloc.patch
blobdd4f9610c7673044572be602925241f93f187459
1 [PATCH] fix two bugs in the PAM object deallocation
3 Fixes https://bugzilla.redhat.com/show_bug.cgi?id=658955
5 Downloaded from:
6 http://pkgs.fedoraproject.org/cgit/PyPAM.git/plain/PyPAM-0.5.0-dealloc.patch
8 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
9 diff -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);
25 static PyObject * PyPAM_getattr(PyPAMObject *self, char *name)