comparison cli-authpubkey.c @ 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 aad4b3f58556
children b895f91c2ee6
comparison
equal deleted inserted replaced
405:00703f1df67a 406:2448ae3e75b5
58 TRACE(("leave cli_pubkeyfail")) 58 TRACE(("leave cli_pubkeyfail"))
59 } 59 }
60 60
61 void recv_msg_userauth_pk_ok() { 61 void recv_msg_userauth_pk_ok() {
62 62
63 struct SignKeyList *keyitem; 63 struct SignKeyList *keyitem = NULL;
64 buffer* keybuf; 64 buffer* keybuf = NULL;
65 char* algotype = NULL; 65 char* algotype = NULL;
66 unsigned int algolen; 66 unsigned int algolen;
67 int keytype; 67 int keytype;
68 unsigned int remotelen; 68 unsigned int remotelen;
69 69
119 * password */ 119 * password */
120 send_msg_userauth_pubkey(keyitem->key, keytype, 1); 120 send_msg_userauth_pubkey(keyitem->key, keytype, 1);
121 } else { 121 } else {
122 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")) 122 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"))
123 } 123 }
124
125 buf_free(keybuf);
124 126
125 TRACE(("leave recv_msg_userauth_pk_ok")) 127 TRACE(("leave recv_msg_userauth_pk_ok"))
126 } 128 }
127 129
128 /* TODO: make it take an agent reference to use as well */ 130 /* TODO: make it take an agent reference to use as well */