]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/options.c
Removed numerous memory leaks detected by Mark Meredith.
[openldap] / libraries / libldap / options.c
index 3e748a7848452c7830b625c047d147990a3ce508..ef19dfda61f273e2ea341c128f99b7863324a252 100644 (file)
@@ -88,11 +88,6 @@ ldap_get_option(
                ldap_int_initialize();
        }
 
-       if(outvalue == NULL) {
-               /* no place to get to */
-               return LDAP_OPT_ERROR;
-       }
-
        if(ld == NULL) {
                lo = &ldap_int_global_options;
 
@@ -106,6 +101,11 @@ ldap_get_option(
                lo = &ld->ld_options;
        }
 
+       if(outvalue == NULL) {
+               /* no place to get to */
+               return LDAP_OPT_ERROR;
+       }
+
        switch(option) {
        case LDAP_OPT_API_INFO: {
                        struct ldapapiinfo *info = (struct ldapapiinfo *) outvalue;
@@ -152,7 +152,7 @@ ldap_get_option(
                        break;
                } 
 
-               * (int *) outvalue = ber_pvt_sb_get_desc( &(ld->ld_sb) );
+               * (ber_socket_t *) outvalue = ber_pvt_sb_get_desc( &(ld->ld_sb) );
                return LDAP_OPT_SUCCESS;
 
        case LDAP_OPT_DEREF: