- (djm) Make portable build with MIT krb5 (some issues remain)
diff --git a/sshconnect2.c b/sshconnect2.c
index 0605e4e..f91f5b2 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -27,8 +27,13 @@
 
 #ifdef KRB5
 #include <krb5.h>
+#ifndef HEIMDAL
+#define krb5_get_err_text(context,code) error_message(code)
+#endif /* !HEIMDAL */
 #endif
 
+#include "openbsd-compat/sys-queue.h"
+
 #include "ssh.h"
 #include "ssh2.h"
 #include "xmalloc.h"
@@ -1206,7 +1211,12 @@
 	packet_put_string(ap.data, ap.length);
 	packet_send();
 
+#ifdef HEIMDAL
 	krb5_data_free(&ap);
+#else
+# warning "XXX - leaks ap data on MIT kerberos"
+#endif
+
 	return (1);
 }
 #endif