Skip to content

Commit

Permalink
rlm_python: Don't leak if got problems to parse the tuple (#2992)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpereira authored and arr2036 committed Sep 14, 2019
1 parent 16118ab commit 7d58095
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/modules/rlm_python/rlm_python.c
Expand Up @@ -408,17 +408,13 @@ static void mod_vptuple(TALLOC_CTX *ctx, rlm_python_t const *inst, REQUEST *requ
/*
* This is the core Python function that the others wrap around.
* Pass the value-pair print strings in a tuple.
*
* FIXME: We're not checking the errors. If we have errors, what
* do we do?
*/
static int mod_populate_vptuple(rlm_python_t const *inst, REQUEST *request, PyObject *pp, VALUE_PAIR *vp)
{
PyObject *attribute = NULL;
PyObject *value = NULL;

/* Look at the fr_pair_fprint_name? */

if (vp->da->flags.has_tag) {
attribute = PyUnicode_FromFormat("%s:%d", vp->da->name, vp->tag);
} else {
Expand Down Expand Up @@ -510,6 +506,7 @@ static int mod_populate_vptuple(rlm_python_t const *inst, REQUEST *request, PyOb
if (value == NULL) {
ROPTIONAL(REDEBUG, ERROR, "Failed marshalling %pP to Python value", vp);
python_error_log(inst, request);
Py_XDECREF(attribute);
return -1;
}

Expand Down

0 comments on commit 7d58095

Please sign in to comment.