From da432d727138c315846fec5f271f065d7b4bc15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Thu, 2 May 2019 09:40:38 +0100 Subject: [PATCH] Do not leak serverctrls --- Modules/LDAPObject.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/LDAPObject.c b/Modules/LDAPObject.c index bc26727..ed4df4c 100644 --- a/Modules/LDAPObject.c +++ b/Modules/LDAPObject.c @@ -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); @@ -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");