From: Kurt Zeilenga Date: Sun, 6 Jan 2002 02:18:37 +0000 (+0000) Subject: Some memory allocation cleanup. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~264 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0c363721341f448d2427fe0580bc7d041e963431;p=openldap Some memory allocation cleanup. --- diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 8bc007e805..63eb7d1357 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -398,7 +398,7 @@ ldap_int_sasl_open( sasl_conn_t *ctx; sasl_callback_t *session_callbacks = - ber_memcalloc( 2, sizeof( sasl_callback_t ) ); + LDAP_CALLOC( 2, sizeof( sasl_callback_t ) ); if( session_callbacks == NULL ) return LDAP_NO_MEMORY; @@ -419,7 +419,7 @@ ldap_int_sasl_open( rc = sasl_client_new( "ldap", host, session_callbacks, SASL_SECURITY_LAYER, &ctx ); - ber_memfree( session_callbacks ); + LDAP_FREE( session_callbacks ); if ( rc != SASL_OK ) { ld->ld_errno = sasl_err2ldap( rc ); diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 0deca52040..918bba0029 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -427,10 +427,9 @@ try_read1msg( } #ifdef LDAP_CONNECTIONLESS if (LDAP_IS_UDP(ld) && ld->ld_options.ldo_version == LDAP_VERSION2) { - char *blank; + char *blank = NULL; ber_scanf(ber, "a{", &blank); - if (blank) - ber_memfree(blank); + if (blank) ber_memfree(blank); } #endif /* the message type */