2c6172
diff -ru gnupg-2.3.8.orig/dirmngr/server.c gnupg-2.3.8/dirmngr/server.c
2c6172
--- gnupg-2.3.8.orig/dirmngr/server.c	2022-10-07 15:23:50.000000000 +0200
2c6172
+++ gnupg-2.3.8/dirmngr/server.c	2022-10-22 15:52:13.224088828 +0200
2c6172
@@ -3137,7 +3137,9 @@
2c6172
                ctrl->refcount);
2c6172
   else
2c6172
     {
2c6172
+#if USE_LDAP
2c6172
       ks_ldap_free_state (ctrl->ks_get_state);
2c6172
+#endif
2c6172
       ctrl->ks_get_state = NULL;
2c6172
       release_ctrl_ocsp_certs (ctrl);
2c6172
       xfree (ctrl->server_local);