]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/addentry.c
ITS#6437 cleanup (noop change): Compute pad,order_start at compile time
[openldap] / libraries / libldap / addentry.c
index 229524cd2ee2f98c1bed6e469e29371e46ef7bea..5194d81b06f3225a9597a912e2684130c770ec0d 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2007 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;
 }