X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Faddentry.c;h=e3d060dd376056c6a4213f64f01f4c5eb8bb050d;hb=cf74dfbb2d1cc91fa3bd4ed74e5eb01a92c0436f;hp=4edeb28aee1bc856a726872c670d6f475be7f999;hpb=dc0eacd40b625258355eea866d62188e5aa7ce3b;p=openldap diff --git a/libraries/libldap/addentry.c b/libraries/libldap/addentry.c index 4edeb28aee..e3d060dd37 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-2005 The OpenLDAP Foundation. + * Copyright 1998-2012 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; }