09299d
--- netkit-ftp-0.17-orig/ftp/ftp.c	2007-08-06 23:32:49.000000000 +0200
09299d
+++ netkit-ftp-0.17/ftp/ftp.c	2007-08-06 23:31:06.000000000 +0200
09299d
@@ -483,8 +483,10 @@ getreply(int expecteof)
09299d
 					return (0);
09299d
 				}
09299d
 				lostpeer(0);
09299d
-				fclose(cout);
09299d
-				cout = NULL;
09299d
+				if (cout) {
09299d
+					fclose(cout);
09299d
+					cout = NULL;
09299d
+				}
09299d
 				if (verbose) {
09299d
 					printf("421 Service not available, remote server has closed connection\n");
09299d
 					(void) fflush(stdout);
09299d