]> git.sur5r.net Git - openldap/commitdiff
trap an issue that occurred in odd conditions
authorPierangelo Masarati <ando@openldap.org>
Wed, 31 May 2006 14:37:05 +0000 (14:37 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 31 May 2006 14:37:05 +0000 (14:37 +0000)
servers/slapd/back-meta/search.c

index 97d0ff58ef83f78a97ea89e394d5918a23b1ccc3..b0267703281367a88c9c40c28a9dc76362c9d6f3 100644 (file)
@@ -246,6 +246,18 @@ meta_back_search_start(
        struct timeval          tv, *tvp = NULL;
        int                     nretries = 1;
 
+       /* this should not happen; just in case... */
+       if ( msc->msc_ld == NULL ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "%s: meta_back_search_start candidate=%d ld=NULL%s.\n",
+                       op->o_log_prefix, candidate,
+                       META_BACK_ONERR_STOP( mi ) ? "" : " (ignored)" );
+               if ( META_BACK_ONERR_STOP( mi ) ) {
+                       return META_SEARCH_ERR;
+               }
+               return META_SEARCH_NOT_CANDIDATE;
+       }
+
        Debug( LDAP_DEBUG_TRACE, "%s >>> meta_back_search_start[%d]\n", op->o_log_prefix, candidate, 0 );
 
        /*