X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fresult.c;h=36df94b712776a5ce60ca65591aeacc7633bde71;hb=8045b54124f0365b3d34d9d3220256f052f2b76b;hp=a004f51440270223c6358f7709d2a7d73deb3ced;hpb=c09a2c63e7e34af648787dbcc4efbe9fcd5646ae;p=openldap diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index a004f51440..36df94b712 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -1,5 +1,6 @@ +/* $OpenLDAP$ */ /* - * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ /* Portions @@ -143,8 +144,11 @@ ldap_result( lastlm->lm_next = (all == 0 && lm->lm_chain != NULL ? lm->lm_chain : lm->lm_next); } - if ( all == 0 ) + if ( all == 0 && lm->lm_chain != NULL ) + { + lm->lm_chain->lm_next = lm->lm_next; lm->lm_chain = NULL; + } lm->lm_next = NULL; *result = lm; @@ -642,7 +646,7 @@ int ldap_msgtype( LDAPMessage *lm ) { assert( lm != NULL ); - return ( lm == NULL ) ? lm->lm_msgtype : -1; + return ( lm != NULL ) ? lm->lm_msgtype : -1; } @@ -651,7 +655,7 @@ ldap_msgid( LDAPMessage *lm ) { assert( lm != NULL ); - return ( lm == NULL ) ? lm->lm_msgid : -1; + return ( lm != NULL ) ? lm->lm_msgid : -1; }