diff --git a/exec/qnet-ftp.src b/exec/qnet-ftp.src
index 4847dd01bb9b51528f8c22b33a0e439f19662e25..ad6506b0b1bf1c4ffe56bdd1741e9acda6e0f254 100644
--- a/exec/qnet-ftp.src
+++ b/exec/qnet-ftp.src
@@ -178,9 +178,11 @@ if_true
 	lprintf "QNET-FTP: Downloaded %s successfully" str
 else
 	lprintf "QNET-FTP: %s NOT downloaded socket_error=%d (no new messages?)" str _socket_error
-    remove_file qwk
+	remove_file qwk
 	end_if
 
+ftp_logout sock
+
 #################
 # Exit routine	#
 #################