diff svr-authpubkey.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 2f64cb3d3007
children dc7c9fdb3716
line wrap: on
line diff
--- a/svr-authpubkey.c	Tue Mar 06 22:02:19 2018 +0800
+++ b/svr-authpubkey.c	Tue Mar 06 22:18:20 2018 +0800
@@ -167,6 +167,10 @@
 		sign_key_free(key);
 		key = NULL;
 	}
+	/* Retain pubkey options only if auth succeeded */
+	if (!ses.authstate.authdone) {
+		svr_pubkey_options_cleanup();
+	}
 	TRACE(("leave pubkeyauth"))
 }