X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Faddentry.c;h=755cf50d8f69b38b39e565458ff68ab5fda2197f;hb=a5cad3f18a4b8fbbbb1bfc5db9d00022d9ebbfc4;hp=229524cd2ee2f98c1bed6e469e29371e46ef7bea;hpb=da6d9eb0463255782f3fa70c61fd958d94c048cf;p=openldap diff --git a/libraries/libldap/addentry.c b/libraries/libldap/addentry.c index 229524cd2e..755cf50d8f 100644 --- a/libraries/libldap/addentry.c +++ b/libraries/libldap/addentry.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2007 The OpenLDAP Foundation. + * Copyright 1998-2010 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -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; }