changeset 406:2448ae3e75b5

Fix leak of keybuf in recv_msg_userauth_pk_ok, courtesy of Klocwork
author Matt Johnston <matt@ucc.asn.au>
date Sat, 03 Feb 2007 13:31:01 +0000
parents 00703f1df67a
children ea0929224294
files cli-authpubkey.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cli-authpubkey.c	Sat Feb 03 13:23:18 2007 +0000
+++ b/cli-authpubkey.c	Sat Feb 03 13:31:01 2007 +0000
@@ -60,8 +60,8 @@
 
 void recv_msg_userauth_pk_ok() {
 
-	struct SignKeyList *keyitem;
-	buffer* keybuf;
+	struct SignKeyList *keyitem = NULL;
+	buffer* keybuf = NULL;
 	char* algotype = NULL;
 	unsigned int algolen;
 	int keytype;
@@ -121,6 +121,8 @@
 	} else {
 		TRACE(("That was whacky. We got told that a key was valid, but it didn't match our list. Sounds like dodgy code on Dropbear's part"))
 	}
+	
+	buf_free(keybuf);
 
 	TRACE(("leave recv_msg_userauth_pk_ok"))
 }