diff --git a/CHANGES b/CHANGES index 8cb2016..aacffd1 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,10 @@ Released 2.4.40 2017-06-xx Changes since 2.4.39: +Modules/ +* fixed memory leaks when using extended controls + (thanks to Erik Cumps) + ---------------------------------------------------------------- Released 2.4.39 2017-05-31 @@ -1448,4 +1452,4 @@ Released 2.0.0pre02 2002-02-01 ---------------------------------------------------------------- Released 1.10alpha3 2000-09-19 -$Id: CHANGES,v 1.448 2017/06/23 07:16:26 stroeder Exp $ +$Id: CHANGES,v 1.449 2017/06/23 18:09:59 stroeder Exp $ diff --git a/Modules/ldapcontrol.c b/Modules/ldapcontrol.c index 14a8625..a1097b3 100644 --- a/Modules/ldapcontrol.c +++ b/Modules/ldapcontrol.c @@ -1,5 +1,5 @@ /* See http://www.python-ldap.org/ for details. - * $Id: ldapcontrol.c,v 1.20 2011/10/26 18:38:06 stroeder Exp $ */ + * $Id: ldapcontrol.c,v 1.21 2017/06/23 18:09:59 stroeder Exp $ */ #include "common.h" #include "LDAPObject.h" @@ -231,6 +231,7 @@ encode_rfc3876(PyObject *self, PyObject *args) } res = LDAPberval_to_object(ctrl_val); + ber_bvfree(ctrl_val); endlbl: if (vrber) @@ -287,6 +288,7 @@ encode_rfc2696(PyObject *self, PyObject *args) } res = LDAPberval_to_object(ctrl_val); + ber_bvfree(ctrl_val); endlbl: if (ber) @@ -324,6 +326,7 @@ decode_rfc2696(PyObject *self, PyObject *args) } res = Py_BuildValue("(lO&)", count, LDAPberval_to_object, cookiep); + ber_bvfree(cookiep); endlbl: if (ber)