summaryrefslogtreecommitdiff
path: root/gss-genr.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-03-26 00:05:23 +1100
committerDamien Miller <djm@mindrot.org>2006-03-26 00:05:23 +1100
commita66cf68dd78aec58d3f7b35c0739eab7069b6936 (patch)
treec34ae58286c42679c6bc98bc2f25bbb82f4a43fd /gss-genr.c
parentf23c09670a2a7a0339daffb7f3340756f6d539de (diff)
- djm@cvs.openbsd.org 2006/03/20 04:07:49
[gss-genr.c] more GSSAPI related leaks detected by Coverity via elad AT netbsd.org; reviewed by simon AT sxw.org.uk; deraadt@ ok
Diffstat (limited to 'gss-genr.c')
-rw-r--r--gss-genr.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gss-genr.c b/gss-genr.c
index c2b4f2dd8..8d75ee5c7 100644
--- a/gss-genr.c
+++ b/gss-genr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gss-genr.c,v 1.6 2005/10/13 22:24:31 stevesk Exp $ */ 1/* $OpenBSD: gss-genr.c,v 1.7 2006/03/20 04:07:49 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. 4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -72,7 +72,11 @@ ssh_gssapi_set_oid(Gssctxt *ctx, gss_OID oid)
72void 72void
73ssh_gssapi_error(Gssctxt *ctxt) 73ssh_gssapi_error(Gssctxt *ctxt)
74{ 74{
75 debug("%s", ssh_gssapi_last_error(ctxt, NULL, NULL)); 75 char *s;
76
77 s = ssh_gssapi_last_error(ctxt, NULL, NULL);
78 debug("%s", s);
79 xfree(s);
76} 80}
77 81
78char * 82char *
@@ -231,11 +235,15 @@ ssh_gssapi_acquire_cred(Gssctxt *ctx)
231 gss_create_empty_oid_set(&status, &oidset); 235 gss_create_empty_oid_set(&status, &oidset);
232 gss_add_oid_set_member(&status, ctx->oid, &oidset); 236 gss_add_oid_set_member(&status, ctx->oid, &oidset);
233 237
234 if (gethostname(lname, MAXHOSTNAMELEN)) 238 if (gethostname(lname, MAXHOSTNAMELEN)) {
239 gss_release_oid_set(&status, &oidset);
235 return (-1); 240 return (-1);
241 }
236 242
237 if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) 243 if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) {
244 gss_release_oid_set(&status, &oidset);
238 return (ctx->major); 245 return (ctx->major);
246 }
239 247
240 if ((ctx->major = gss_acquire_cred(&ctx->minor, 248 if ((ctx->major = gss_acquire_cred(&ctx->minor,
241 ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds, NULL, NULL))) 249 ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds, NULL, NULL)))