]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backend.c
A follow-on commit to the previous @oc support change to use anlist
[openldap] / servers / slapd / backend.c
index 4e7d25acda88f1f155fde55d34f8b9dfbed530f8..e6e7675f47f4b2cca540a665e0a4b7ff40d56198 100644 (file)
@@ -483,11 +483,13 @@ int backend_destroy(void)
                        syncinfo_free( si_entry );
                }
 
-               LDAP_TAILQ_FOREACH( csne, bd->be_pending_csn_list, ce_csn_link ) {
-                       LDAP_TAILQ_REMOVE( bd->be_pending_csn_list, csne, ce_csn_link );
-                       ch_free( csne->ce_csn->bv_val );
-                       ch_free( csne->ce_csn );
-                       ch_free( csne );
+               if ( bd->be_pending_csn_list ) {
+                       LDAP_TAILQ_FOREACH( csne, bd->be_pending_csn_list, ce_csn_link ) {
+                               LDAP_TAILQ_REMOVE( bd->be_pending_csn_list, csne, ce_csn_link );
+                               ch_free( csne->ce_csn->bv_val );
+                               ch_free( csne->ce_csn );
+                               ch_free( csne );
+                       }
                }
                
                if ( bd->bd_info->bi_db_destroy ) {