]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/config.c
Plug mutex/rwlock leaks (destroy them)
[openldap] / servers / slapd / config.c
index c18ed041fd028971b2904ba996515969f8e8eba3..abb1d79f4a4b740b83594a80c87a475975f2a8e6 100644 (file)
@@ -467,7 +467,7 @@ config_get_vals(ConfigTable *cf, ConfigArgs *c)
                                c->value_string = ch_strdup(*(char **)ptr);
                        break;
                case ARG_BERVAL:
-                       ber_dupbv( &c->value_bv, (struct berval *)ptr ); break;
+                       c->value_bv = *((struct berval *)ptr); break;
                case ARG_ATDESC:
                        c->value_ad = *(AttributeDescription **)ptr; break;
                }
@@ -1210,30 +1210,6 @@ static slap_verbmasks versionkey[] = {
        { BER_BVNULL, 0 }
 };
 
-static int
-slap_sb_uri(
-       struct berval *val,
-       void *bcp,
-       slap_cf_aux_table *tab0,
-       const char *tabmsg,
-       int unparse )
-{
-       slap_bindconf *bc = bcp;
-       if ( unparse ) {
-               if ( bc->sb_uri.bv_len >= val->bv_len )
-                       return -1;
-               val->bv_len = bc->sb_uri.bv_len;
-               AC_MEMCPY( val->bv_val, bc->sb_uri.bv_val, val->bv_len );
-       } else {
-               bc->sb_uri = *val;
-#ifdef HAVE_TLS
-               if ( ldap_is_ldaps_url( val->bv_val ))
-                       bc->sb_tls_do_init = 1;
-#endif
-       }
-       return 0;
-}
-
 static int 
 slap_keepalive_parse(
        struct berval *val,
@@ -1320,6 +1296,30 @@ slap_keepalive_parse(
        return 0;
 }
 
+static int
+slap_sb_uri(
+       struct berval *val,
+       void *bcp,
+       slap_cf_aux_table *tab0,
+       const char *tabmsg,
+       int unparse )
+{
+       slap_bindconf *bc = bcp;
+       if ( unparse ) {
+               if ( bc->sb_uri.bv_len >= val->bv_len )
+                       return -1;
+               val->bv_len = bc->sb_uri.bv_len;
+               AC_MEMCPY( val->bv_val, bc->sb_uri.bv_val, val->bv_len );
+       } else {
+               bc->sb_uri = *val;
+#ifdef HAVE_TLS
+               if ( ldap_is_ldaps_url( val->bv_val ))
+                       bc->sb_tls_do_init = 1;
+#endif
+       }
+       return 0;
+}
+
 static slap_cf_aux_table bindkey[] = {
        { BER_BVC("uri="), 0, 'x', 1, slap_sb_uri },
        { BER_BVC("version="), offsetof(slap_bindconf, sb_version), 'i', 0, versionkey },
@@ -1441,20 +1441,6 @@ slap_cf_aux_table_parse( const char *word, void *dst, slap_cf_aux_table *tab0, L
                                rc = lutil_atoulx( ulptr, val, 0 );
                                break;
 
-                       case 'x':
-                               if ( tab->aux != NULL ) {
-                                       struct berval value;
-                                       slap_cf_aux_table_parse_x *func = (slap_cf_aux_table_parse_x *)tab->aux;
-
-                                       ber_str2bv( val, 0, 1, &value );
-
-                                       rc = func( &value, (void *)((char *)dst + tab->off), tab, tabmsg, 0 );
-
-                               } else {
-                                       rc = 1;
-                               }
-                               break;
-
                        case 'x':
                                if ( tab->aux != NULL ) {
                                        struct berval value;
@@ -1586,26 +1572,6 @@ slap_cf_aux_table_unparse( void *src, struct berval *bv, slap_cf_aux_table *tab0
                        }
                        break;
 
-               case 'x':
-                       *ptr++ = ' ';
-                       ptr = lutil_strcopy( ptr, tab->key.bv_val );
-                       if ( tab->quote ) *ptr++ = '"';
-                       if ( tab->aux != NULL ) {
-                               struct berval value;
-                               slap_cf_aux_table_parse_x *func = (slap_cf_aux_table_parse_x *)tab->aux;
-                               int rc;
-
-                               value.bv_val = ptr;
-                               value.bv_len = buf + sizeof( buf ) - ptr;
-
-                               rc = func( &value, (void *)((char *)src + tab->off), tab, "(unparse)", 1 );
-                               if ( rc == 0 ) {
-                                       ptr += value.bv_len;
-                               }
-                       }
-                       if ( tab->quote ) *ptr++ = '"';
-                       break;
-
                default:
                        assert( 0 );
                }