{
LDAPMessage *lm, *lastlm, *nextlm;
+ assert( ld != NULL );
+ assert( result != NULL );
+
+ Debug( LDAP_DEBUG_TRACE, "ldap_result\n", 0, 0, 0 );
+
+ if( ld == NULL ) {
+ return -1;
+ }
+
+ if( result == NULL ) {
+ ld->ld_errno = LDAP_PARAM_ERROR;
+ return -1;
+ }
+
/*
* First, look through the list of responses we have received on
* this association and see if the response we're interested in
* wait until it arrives or timeout occurs.
*/
- Debug( LDAP_DEBUG_TRACE, "ldap_result\n", 0, 0, 0 );
-
*result = NULLMSG;
lastlm = NULLMSG;
for ( lm = ld->ld_responses; lm != NULLMSG; lm = nextlm ) {
LDAPConn *lc, *nextlc;
#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
+ assert( ld != NULL );
+ assert( result != NULL );
+
#ifdef LDAP_DEBUG
if ( timeout == NULL ) {
Debug( LDAP_DEBUG_TRACE, "wait4msg (infinite timeout)\n",
BerElement tmpber;
int rc, refer_cnt, hadref, simple_request;
unsigned long lderr;
+
+ assert( ld != NULL );
+ assert( lc != NULL );
ber = &lc->lconn_ber;
+
#else
+ assert( ld != NULL );
+
ber = &ld->ld_ber;
#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
Debug( LDAP_DEBUG_TRACE, "read1msg\n", 0, 0, 0 );
+
#if 0
ber_init_w_nullc( &ber, 0 );
ldap_set_ber_options( ld, &ber );
fd_set readfds;
static int tblsize;
+ assert( ld != NULL );
+
if ( tblsize == 0 ) {
#ifdef HAVE_SYSCONF
tblsize = sysconf( _SC_OPEN_MAX );
int
ldap_msgtype( LDAPMessage *lm )
{
- return( lm ? lm->lm_msgtype : -1 );
+ assert( lm != NULL );
+ return ( lm == NULL ) ? lm->lm_msgtype : -1;
}
+
int
ldap_msgid( LDAPMessage *lm )
{
- return( lm ? lm->lm_msgid : -1 );
+ assert( lm != NULL );
+
+ return ( lm == NULL ) ? lm->lm_msgid : -1;
}
LDAPMessage *next;
int type = 0;
+ assert( lm != NULL );
+
Debug( LDAP_DEBUG_TRACE, "ldap_msgfree\n", 0, 0, 0 );
for ( ; lm != NULLMSG; lm = next ) {
{
LDAPMessage *lm, *prev;
+ assert( ld != NULL );
+
Debug( LDAP_DEBUG_TRACE, "ldap_msgdelete\n", 0, 0, 0 );
prev = NULLMSG;