summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-10-07 21:58:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-10-07 21:58:29 +0000
commit47362784b4beb068c3781701f6a1b3708cb84041 (patch)
tree83339dfa96f43661ebcf26758a255f0762caaed9
parentde70ac7a55a11e060c6f1843bd0e42d19d0b1d13 (diff)
set ptr to NULL after free
-rw-r--r--usr.bin/ssh/sshconnect2.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c
index b33e396634b..9102031fc8f 100644
--- a/usr.bin/ssh/sshconnect2.c
+++ b/usr.bin/ssh/sshconnect2.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshconnect2.c,v 1.125 2003/10/07 01:47:27 dtucker Exp $");
+RCSID("$OpenBSD: sshconnect2.c,v 1.126 2003/10/07 21:58:28 deraadt Exp $");
#include "ssh.h"
#include "ssh2.h"
@@ -356,6 +356,7 @@ void
input_userauth_banner(int type, u_int32_t seq, void *ctxt)
{
char *msg, *lang;
+
debug3("input_userauth_banner");
msg = packet_get_string(NULL);
lang = packet_get_string(NULL);
@@ -371,10 +372,14 @@ input_userauth_success(int type, u_int32_t seq, void *ctxt)
Authctxt *authctxt = ctxt;
if (authctxt == NULL)
fatal("input_userauth_success: no authentication context");
- if (authctxt->authlist)
+ if (authctxt->authlist) {
xfree(authctxt->authlist);
- if (authctxt->methoddata)
+ authctxt->authlist = NULL;
+ }
+ if (authctxt->methoddata) {
xfree(authctxt->methoddata);
+ authctxt->methoddata = NULL;
+ }
authctxt->success = 1; /* break out */
}
@@ -607,7 +612,7 @@ input_gssapi_token(int type, u_int32_t plen, void *ctxt)
packet_check_eom();
- status=ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
+ status = ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
&recv_tok, &send_tok, NULL);
xfree(recv_tok.value);