]> git.sur5r.net Git - openldap/commitdiff
ITS#7381 more for prev commit
authorHoward Chu <hyc@openldap.org>
Mon, 9 Sep 2013 11:59:20 +0000 (04:59 -0700)
committerHoward Chu <hyc@openldap.org>
Mon, 9 Sep 2013 11:59:20 +0000 (04:59 -0700)
servers/slapd/back-ldap/chain.c

index a7c53ed41bddf91adf858548c9c421195f4d1076..d2e3e2441a2f22b39e37762c9e44f9c2186a3089 100644 (file)
@@ -1356,17 +1356,18 @@ fail:
 
        li = ca->be->be_private;
 
-
-       li->li_uri = ch_strdup( at->a_vals[ 0 ].bv_val );
-       value_add_one( &li->li_bvuri, &at->a_vals[ 0 ] );
-       if ( avl_insert( &lc->lc_lai.lai_tree, (caddr_t)li,
-               ldap_chain_uri_cmp, ldap_chain_uri_dup ) )
-       {
-               Debug( LDAP_DEBUG_ANY, "slapd-chain: "
-                       "database \"%s\" insert failed.\n",
-                       e->e_name.bv_val, 0, 0 );
-               rc = LDAP_CONSTRAINT_VIOLATION;
-               goto done;
+       if ( at ) {
+               li->li_uri = ch_strdup( at->a_vals[ 0 ].bv_val );
+               value_add_one( &li->li_bvuri, &at->a_vals[ 0 ] );
+               if ( avl_insert( &lc->lc_lai.lai_tree, (caddr_t)li,
+                       ldap_chain_uri_cmp, ldap_chain_uri_dup ) )
+               {
+                       Debug( LDAP_DEBUG_ANY, "slapd-chain: "
+                               "database \"%s\" insert failed.\n",
+                               e->e_name.bv_val, 0, 0 );
+                       rc = LDAP_CONSTRAINT_VIOLATION;
+                       goto done;
+               }
        }
 
        ca->ca_private = on;