]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/request.c
Cast char* argument to hh_to_c() to Byte*
[openldap] / libraries / libldap / request.c
index a9f7dbf0faae882ed3e181caf4ae59f6ae67f0ee..5b8ecc8c5e45a0d4028f7b2f7a8288a95f348e85 100644 (file)
@@ -21,6 +21,7 @@
 #include <ac/unistd.h>
 
 #include "ldap-int.h"
+#include "lber.h"
 
 #if defined( LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS ) || defined( LDAP_API_FEATURE_X_OPENLDAP_V2_DNS )
 static LDAPConn *find_connection LDAP_P(( LDAP *ld, LDAPServer *srv, int any ));
@@ -350,7 +351,7 @@ ldap_new_connection( LDAP *ld, LDAPServer **srvlistp, int use_ldsb,
 
                freepasswd = err = 0;
 
-               if ( ld->ld_rebindproc == NULL ) {
+               if ( ld->ld_rebindproc == 0 ) {
                        binddn = passwd = "";
                        authmethod = LDAP_AUTH_SIMPLE;
                } else {
@@ -444,6 +445,7 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind )
                        }
                        ldap_close_connection( lc->lconn_sb );
                        lber_pvt_sb_destroy( lc->lconn_sb );
+                       ber_clear( &lc->lconn_ber, 1 );
                }
                prevlc = NULL;
                for ( tmplc = ld->ld_conns; tmplc != NULL;