diff --git a/svr-chansession.c b/svr-chansession.c
index 5bed8fc7d2fbc3c8270785cbf7c857da8f7904d4..6d08d3f8360dbbeab721963ddddcf3657470ec58 100644
--- a/svr-chansession.c
+++ b/svr-chansession.c
@@ -603,6 +603,7 @@ static int sessionpty(struct ChanSess * chansess) {
 	return DROPBEAR_SUCCESS;
 }
 
+#ifndef USE_VFORK
 static void make_connection_string(struct ChanSess *chansess) {
 	char *local_ip, *local_port, *remote_ip, *remote_port;
 	size_t len;
@@ -624,6 +625,7 @@ static void make_connection_string(struct ChanSess *chansess) {
 	m_free(remote_ip);
 	m_free(remote_port);
 }
+#endif
 
 /* Handle a command request from the client. This is used for both shell
  * and command-execution requests, and passes the command to