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