X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=libraries%2Flibldap%2Faddentry.c;h=5194d81b06f3225a9597a912e2684130c770ec0d;hb=8fd5fa0ed82c3a9e980f75a84933e3c3ae0cd5f0;hp=58e90856db68d614d29ead6684d2b2d2bfb35797;hpb=acbb5cf689a4336af05c9f259d909d8141055bac;p=openldap diff --git a/libraries/libldap/addentry.c b/libraries/libldap/addentry.c index 58e90856db..5194d81b06 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-2006 The OpenLDAP Foundation. + * Copyright 1998-2011 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; }