diff fuzzer-pubkey.c @ 1598:252b406d0e9a

avoid leak of pubkey_options
author Matt Johnston <matt@ucc.asn.au>
date Tue, 06 Mar 2018 22:18:20 +0800
parents e6a5e51a29c9
children ba6fc7afe1c5
line wrap: on
line diff
--- a/fuzzer-pubkey.c	Tue Mar 06 22:02:19 2018 +0800
+++ b/fuzzer-pubkey.c	Tue Mar 06 22:18:20 2018 +0800
@@ -30,10 +30,16 @@
 		if (have_algo(algoname, algolen, sshhostkey) == DROPBEAR_FAILURE) {
 			dropbear_exit("fuzzer imagined a bogus algorithm");
 		}
-		fuzz_checkpubkey_line(line, 5, "/home/me/authorized_keys",
+
+		int ret = fuzz_checkpubkey_line(line, 5, "/home/me/authorized_keys",
 			algoname, algolen,
 			keyblob->data, keyblob->len);
 
+		if (ret == DROPBEAR_SUCCESS) {
+			/* fuzz_checkpubkey_line() should have cleaned up for failure */
+			svr_pubkey_options_cleanup();
+		}
+
 		buf_free(line);
 		buf_free(keyblob);
 		m_free(algoname);