Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in ldap_cancel #82

Closed
tiran opened this issue Dec 4, 2017 · 2 comments
Closed

Memory leak in ldap_cancel #82

tiran opened this issue Dec 4, 2017 · 2 comments

Comments

@tiran
Copy link
Member

tiran commented Dec 4, 2017

l_ldap_cancel leaks memory to BER data structure. This one looks like a bug in OpenLDAP, not in python-ldap.

==30178== 22 (16 direct, 6 indirect) bytes in 1 blocks are definitely lost in loss record 27 of 5,810
==30178==    at 0x4C2FB6B: malloc (vg_replace_malloc.c:299)
==30178==    by 0x14CBD9E4: ber_memalloc_x (memory.c:228)
==30178==    by 0x14CBC940: ber_flatten (io.c:437)
==30178==    by 0x14A81733: ldap_cancel (cancel.c:50)
==30178==    by 0x1485A3BA: l_ldap_cancel (LDAPObject.c:779)
==30178==    by 0x4FC24EF: PyCFunction_Call (in /usr/lib64/libpython3.6m.so.1.0)
==30178==    by 0x4FF891C: _PyEval_EvalFrameDefault (in /usr/lib64/libpython3.6m.so.1.0)
==30178==    by 0x4F590B2: ??? (in /usr/lib64/libpython3.6m.so.1.0)
==30178==    by 0x4F8BE10: ??? (in /usr/lib64/libpython3.6m.so.1.0)
==30178==    by 0x4FC933D: ??? (in /usr/lib64/libpython3.6m.so.1.0)
==30178==    by 0x4FF2EC9: _PyEval_EvalFrameDefault (in /usr/lib64/libpython3.6m.so.1.0)
==30178==    by 0x4F590B2: ??? (in /usr/lib64/libpython3.6m.so.1.0)
@tiran
Copy link
Member Author

tiran commented Dec 4, 2017

Code: https://github.com/openldap/openldap/blob/master/libraries/libldap/cancel.c#L43-L55

I think ldap_cancel is missing a ber_bvfree(cancelidvalp).

Upstream issue: http://www.openldap.org/its/index.cgi/Incoming?id=8782

@tiran
Copy link
Member Author

tiran commented Dec 5, 2017

Fixed upstream in openldap/openldap@f82ca15

@tiran tiran closed this as completed Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant