From 819566415e6e7b59cc336695e455063db8848332 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 9 Sep 2013 04:59:20 -0700 Subject: [PATCH] ITS#7381 more for prev commit --- servers/slapd/back-ldap/chain.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/servers/slapd/back-ldap/chain.c b/servers/slapd/back-ldap/chain.c index a7c53ed41b..d2e3e2441a 100644 --- a/servers/slapd/back-ldap/chain.c +++ b/servers/slapd/back-ldap/chain.c @@ -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; -- 2.39.5