diff options
author | Milan Jurik <Milan.Jurik@Sun.COM> | 2009-08-09 09:31:03 +0100 |
---|---|---|
committer | Milan Jurik <Milan.Jurik@Sun.COM> | 2009-08-09 09:31:03 +0100 |
commit | 0c71ee58938636c3d3ad26d13891ca5d84934f03 (patch) | |
tree | a6a449064be14d9d2dcec3b6d3fea92e7d2724ba /usr/src/lib/libldap5/sources/ldap/common/sasl.c | |
parent | e944850b16b5f1c0446b0e09400846b63b1ee8a3 (diff) | |
download | illumos-gate-0c71ee58938636c3d3ad26d13891ca5d84934f03.tar.gz |
6851301 libldap5 leaks ~64K per SASL connection
Diffstat (limited to 'usr/src/lib/libldap5/sources/ldap/common/sasl.c')
-rw-r--r-- | usr/src/lib/libldap5/sources/ldap/common/sasl.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/usr/src/lib/libldap5/sources/ldap/common/sasl.c b/usr/src/lib/libldap5/sources/ldap/common/sasl.c index 4252da65d5..8f294f9a29 100644 --- a/usr/src/lib/libldap5/sources/ldap/common/sasl.c +++ b/usr/src/lib/libldap5/sources/ldap/common/sasl.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef LDAP_SASLIO_HOOKS #include <assert.h> #include "ldap-int.h" @@ -587,11 +585,22 @@ nsldapi_sasl_open(LDAP *ld) return( LDAP_SUCCESS ); } +static void +destroy_sasliobuf(Sockbuf *sb) +{ + if (sb != NULL && sb->sb_sasl_ibuf != NULL) { + NSLDAPI_FREE(sb->sb_sasl_ibuf); + sb->sb_sasl_ibuf = NULL; + } +} + static int nsldapi_sasl_close( LDAP *ld, Sockbuf *sb ) { sasl_conn_t *ctx = (sasl_conn_t *)sb->sb_sasl_ctx; + destroy_sasliobuf(sb); + if( ctx != NULL ) { sasl_dispose( &ctx ); sb->sb_sasl_ctx = NULL; |