diff options
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; |