Ian Kent 36ee82
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
Ian Kent 36ee82
index bad48bb..93a1b40 100644
Ian Kent 36ee82
--- a/modules/lookup_ldap.c
Ian Kent 36ee82
+++ b/modules/lookup_ldap.c
Ian Kent 36ee82
@@ -579,7 +579,9 @@ static LDAP *do_reconnect(unsigned logopt, struct lookup_context *ctxt)
Ian Kent 36ee82
 		list_add_tail(&this->list, ctxt->uri);
Ian Kent 36ee82
 	}
Ian Kent 36ee82
 
Ian Kent 36ee82
+#ifdef WITH_SASL
Ian Kent 36ee82
 	autofs_sasl_done(ctxt);
Ian Kent 36ee82
+#endif
Ian Kent 36ee82
 
Ian Kent 36ee82
 	/* Current server failed connect, try the rest */
Ian Kent 36ee82
 	ldap = find_server(logopt, ctxt);