X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fcyrus.c;h=3fd756b31f13756a5e4ffdbe6ccd62e52735299d;hb=64bd9f6abc740ba6c5f1e124be37293921501bdf;hp=1ca9ab4ff32fb0b600caef3b2d63630c23a698ff;hpb=1f6f4f4f281fd7da7b66c05606b66b029d87032f;p=openldap diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 1ca9ab4ff3..3fd756b31f 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2014 The OpenLDAP Foundation. + * Copyright 1998-2016 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -493,11 +493,12 @@ ldap_int_sasl_bind( 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; @@ -1171,6 +1172,7 @@ void *ldap_pvt_sasl_mutex_new(void) 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 */