/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2014 The OpenLDAP Foundation.
+ * Copyright 1998-2015 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
if ( ldap_pvt_tls_get_unique( ssl, &cbv, 0 )) {
sasl_channel_binding_t *cb = ldap_memalloc( sizeof(*cb) +
cbv.bv_len);
+ void *cb_data; /* used since cb->data is const* */
cb->name = "ldap";
cb->critical = 0;
- cb->data = (char *)(cb+1);
cb->len = cbv.bv_len;
- memcpy( cb->data, cbv.bv_val, cbv.bv_len );
+ cb->data = cb_data = cb+1;
+ memcpy( cb_data, cbv.bv_val, cbv.bv_len );
sasl_setprop( ld->ld_defconn->lconn_sasl_authctx,
SASL_CHANNEL_BINDING, cb );
ld->ld_defconn->lconn_sasl_cbind = cb;
if ( ldap_pvt_thread_mutex_init( mutex ) == 0 ) {
return mutex;
}
+ LDAP_FREE( mutex );
#ifndef LDAP_DEBUG_R_SASL
assert( 0 );
#endif /* !LDAP_DEBUG_R_SASL */