Skip to content

Commit

Permalink
Do not leak serverctrls
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondřej Kuzník authored and Petr Viktorin committed Sep 20, 2019
1 parent 4339169 commit da432d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Modules/LDAPObject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,7 @@ l_ldap_result4(LDAPObject *self, PyObject *args)
}
else
e = "ldap_parse_result";
ldap_controls_free(serverctrls);
ldap_msgfree(msg);
Py_XDECREF(valuestr);
return LDAPerror(self->ldap, e);
Expand All @@ -1182,6 +1183,7 @@ l_ldap_result4(LDAPObject *self, PyObject *args)
LDAP_BEGIN_ALLOW_THREADS(self);
ldap_set_option(self->ldap, LDAP_OPT_ERROR_NUMBER, &err);
LDAP_END_ALLOW_THREADS(self);
ldap_controls_free(serverctrls);
ldap_msgfree(msg);
Py_XDECREF(valuestr);
return LDAPerror(self->ldap, "LDAPControls_to_List");
Expand Down

0 comments on commit da432d7

Please sign in to comment.