diff cli-session.c @ 1742:6e71440b1e47 fuzz

Add fuzzer-client_nomaths, fix client fuzzer
author Matt Johnston <matt@ucc.asn.au>
date Sun, 18 Oct 2020 15:08:54 +0800
parents d1b279aa5ed1
children 1fc0012b9c38
line wrap: on
line diff
--- a/cli-session.c	Sun Oct 18 12:17:39 2020 +0800
+++ b/cli-session.c	Sun Oct 18 15:08:54 2020 +0800
@@ -352,6 +352,11 @@
 	(void)fcntl(cli_ses.stdoutcopy, F_SETFL, cli_ses.stdoutflags);
 	(void)fcntl(cli_ses.stderrcopy, F_SETFL, cli_ses.stderrflags);
 
+	/* Don't leak */
+	m_close(cli_ses.stdincopy);
+	m_close(cli_ses.stdoutcopy);
+	m_close(cli_ses.stderrcopy);
+
 	cli_tty_cleanup();
 	if (cli_ses.server_sig_algs) {
 		buf_free(cli_ses.server_sig_algs);
@@ -430,17 +435,18 @@
 
 	/* Do the cleanup first, since then the terminal will be reset */
 	session_cleanup();
-	/* Avoid printing onwards from terminal cruft */
-	fprintf(stderr, "\n");
-
-	dropbear_log(LOG_INFO, "%s", fullmsg);
-
+	
 #if DROPBEAR_FUZZ
     if (fuzz.do_jmp) {
         longjmp(fuzz.jmp, 1);
     }
 #endif
 
+	/* Avoid printing onwards from terminal cruft */
+	fprintf(stderr, "\n");
+
+	dropbear_log(LOG_INFO, "%s", fullmsg);
+
 	exit(exitcode);
 }