]> git.sur5r.net Git - openldap/commitdiff
ITS#5056 fix chain_tail processing
authorHoward Chu <hyc@openldap.org>
Fri, 20 Jul 2007 21:28:04 +0000 (21:28 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 20 Jul 2007 21:28:04 +0000 (21:28 +0000)
libraries/libldap/addentry.c

index 229524cd2ee2f98c1bed6e469e29371e46ef7bea..db4568dc7f3257bc7585289d604f5399b99dfa7f 100644 (file)
@@ -64,6 +64,9 @@ ldap_add_result_entry( LDAPMessage **list, LDAPMessage *e )
        assert( e != NULL );
 
        e->lm_chain = *list;
-       e->lm_chain_tail = (*list)->lm_chain_tail;
+       if ( *list )
+               e->lm_chain_tail = (*list)->lm_chain_tail;
+       else
+               e->lm_chain_tail = e;
        *list = e;
 }