Skip to content

Commit 9524dd3

Browse files
tiranencukou
authored andcommitted
Fix memory leak in whoami_s
l_ldap_whoami_s() did not free the berval struct from ldap_whoami_s(). python-ldap#84 Closes: python-ldap#80 Signed-off-by: Christian Heimes <cheimes@redhat.com>
1 parent cd6f620 commit 9524dd3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Modules/
3333
* Fix multiple ref leaks in error-handling code
3434
* Fix reference leak in result4
3535
* Fix several compiler warnings
36+
* Fix memory leak in whoami
3637
and, thanks to Michael Ströder:
3738
* removed unused code schema.c
3839
* moved code from version.c to ldapmodule.c

Modules/LDAPObject.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,10 +1227,13 @@ l_ldap_whoami_s( LDAPObject* self, PyObject* args )
12271227
LDAPControl_List_DEL( server_ldcs );
12281228
LDAPControl_List_DEL( client_ldcs );
12291229

1230-
if ( ldaperror!=LDAP_SUCCESS )
1230+
if ( ldaperror!=LDAP_SUCCESS ) {
1231+
ber_bvfree(bvalue);
12311232
return LDAPerror( self->ldap, "ldap_whoami_s" );
1233+
}
12321234

12331235
result = LDAPberval_to_unicode_object(bvalue);
1236+
ber_bvfree(bvalue);
12341237

12351238
return result;
12361239
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy