]> git.sur5r.net Git - openldap/commitdiff
Some memory allocation cleanup.
authorKurt Zeilenga <kurt@openldap.org>
Sun, 6 Jan 2002 02:18:37 +0000 (02:18 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 6 Jan 2002 02:18:37 +0000 (02:18 +0000)
libraries/libldap/cyrus.c
libraries/libldap/result.c

index 8bc007e805de4fd7dd5d4c93d24183e654aa9efa..63eb7d1357cc207155ce66b5e29fbdeb759c75ff 100644 (file)
@@ -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 );
index 0deca52040fdec040956dd5d29a86494d49e7967..918bba0029c8aa397ccdb6203c9b249b10659217 100644 (file)
@@ -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 */