]> git.sur5r.net Git - openldap/commitdiff
Plug leaks (ITS#1116)
authorKurt Zeilenga <kurt@openldap.org>
Tue, 6 Nov 2001 17:05:51 +0000 (17:05 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 6 Nov 2001 17:05:51 +0000 (17:05 +0000)
Patch provided by John Morrissey <jwm@horde.net>

libraries/libldap/cyrus.c
libraries/libldap/open.c
libraries/libldap/unbind.c

index 3c528561e22250e3b968d504fe5223b6bb527863..d262410e33dd55af97eefb49fba857fe8f58b3a1 100644 (file)
@@ -419,6 +419,7 @@ ldap_int_sasl_open(
 
        rc = sasl_client_new( "ldap", host, session_callbacks,
                SASL_SECURITY_LAYER, &ctx );
+       ber_memfree( session_callbacks );
 
        if ( rc != SASL_OK ) {
                ld->ld_errno = sasl_err2ldap( rc );
index 25e0519edffcc114964f9b6654b03394c206f7a1..943d61994bd92ba3fa427ccf865b7e115c351487 100644 (file)
@@ -358,6 +358,7 @@ ldap_int_open_connection(
                that SASL EXTERNAL might be used */
        if( sasl_host != NULL ) {
                ldap_int_sasl_open( ld, conn, sasl_host, sasl_ssf );
+               LDAP_FREE( sasl_host );
        }
 #endif
 
index b138161a41fd1a5b5ae3b551357e1af0606501d3..bc19269c3b9bf19e837d11a8a6bfe5819fdd8fbd 100644 (file)
@@ -131,6 +131,26 @@ ldap_ld_free(
                ld->ld_options.ldo_tm_net = NULL;
        }
 
+       if ( ld->ld_options.ldo_def_sasl_mech != NULL ) {
+               LDAP_FREE( ld->ld_options.ldo_def_sasl_mech );
+               ld->ld_options.ldo_def_sasl_mech = NULL;
+       }
+
+       if ( ld->ld_options.ldo_def_sasl_realm != NULL ) {
+               LDAP_FREE( ld->ld_options.ldo_def_sasl_realm );
+               ld->ld_options.ldo_def_sasl_realm = NULL;
+       }
+
+       if ( ld->ld_options.ldo_def_sasl_authcid != NULL ) {
+               LDAP_FREE( ld->ld_options.ldo_def_sasl_authcid );
+               ld->ld_options.ldo_def_sasl_authcid = NULL;
+       }
+
+       if ( ld->ld_options.ldo_def_sasl_authzid != NULL ) {
+               LDAP_FREE( ld->ld_options.ldo_def_sasl_authzid );
+               ld->ld_options.ldo_def_sasl_authzid = NULL;
+       }
+
        ber_sockbuf_free( ld->ld_sb );   
    
        LDAP_FREE( (char *) ld );