aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-pam/PyPAM-0.5.0-nofree.patch
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-12-15 07:45:15 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-12-15 07:45:15 +0000
commit6928abc43e245aae98a620afa35a1c76c7e55417 (patch)
treecf1570ab2690681d6101b8b752f1871250c85dd8 /testing/py-pam/PyPAM-0.5.0-nofree.patch
parent0648d40beb7f4599fae6376eb7e1eda69a6b0266 (diff)
downloadaports-6928abc43e245aae98a620afa35a1c76c7e55417.tar.bz2
aports-6928abc43e245aae98a620afa35a1c76c7e55417.tar.xz
testing/py-pam: new aport
Diffstat (limited to 'testing/py-pam/PyPAM-0.5.0-nofree.patch')
-rw-r--r--testing/py-pam/PyPAM-0.5.0-nofree.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/testing/py-pam/PyPAM-0.5.0-nofree.patch b/testing/py-pam/PyPAM-0.5.0-nofree.patch
new file mode 100644
index 0000000000..f27e9d543d
--- /dev/null
+++ b/testing/py-pam/PyPAM-0.5.0-nofree.patch
@@ -0,0 +1,60 @@
+diff --git a/PAMmodule.c b/PAMmodule.c
+index 03cb799..a7ff8a5 100644
+--- a/PAMmodule.c
++++ b/PAMmodule.c
+@@ -24,8 +24,6 @@ typedef struct {
+ char *service;
+ char *user;
+ PyObject *callback;
+- struct pam_response *response_data;
+- int response_len;
+ PyObject *user_data;
+ void *dlh1, *dlh2;
+ } PyPAMObject;
+@@ -54,15 +52,6 @@ static int PyPAM_conv(int num_msg, const struct pam_message **msg,
+
+ Py_INCREF(self);
+
+- if (NULL != self->response_data) {
+- for (int i = 0; i < self->response_len; i++) {
+- free(self->response_data[0].resp);
+- }
+- free(self->response_data);
+- self->response_data = NULL;
+- self->response_len = 0;
+- }
+-
+ PyObject* msgList = PyList_New(num_msg);
+
+ for (int i = 0; i < num_msg; i++) {
+@@ -92,6 +81,10 @@ static int PyPAM_conv(int num_msg, const struct pam_message **msg,
+ char* resp_text;
+ int resp_retcode = 0;
+ if (!PyArg_ParseTuple(respTuple, "si", &resp_text, &resp_retcode)) {
++ while (i > 0) {
++ free((--spr)->resp);
++ --i;
++ }
+ free(*resp);
+ Py_DECREF(respList);
+ return PAM_CONV_ERR;
+@@ -100,10 +93,6 @@ static int PyPAM_conv(int num_msg, const struct pam_message **msg,
+ spr->resp_retcode = resp_retcode;
+ Py_DECREF(respTuple);
+ }
+-
+- // Save this so we can free it later.
+- self->response_data = *resp;
+- self->response_len = PyList_Size(respList);
+
+ Py_DECREF(respList);
+
+@@ -144,8 +133,6 @@ static PyObject * PyPAM_pam(PyObject *self, PyObject *args)
+ p->user = NULL;
+ Py_INCREF(Py_None);
+ p->callback = Py_None;
+- p->response_data = NULL;
+- p->response_len = 0;
+ Py_INCREF(Py_None);
+ p->user_data = Py_None;
+