summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2011-09-20 19:58:37 -0700
committerRuss Allbery <rra@stanford.edu>2011-09-20 19:58:37 -0700
commit5cc872d3bdc903f5603d7707b92715891f00d434 (patch)
tree1fdcf37ccb36e1281397548de36b8c60fa966f20 /client
parentdfc13f92572a22029c58aa3d2ef1b2e68af010a6 (diff)
Don't leak the client GSS-API context
Close a client memory leak caused by the GSS-API context not being freed by the client in remctl_close.
Diffstat (limited to 'client')
-rw-r--r--client/api.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/client/api.c b/client/api.c
index ca50aa3..cd06cda 100644
--- a/client/api.c
+++ b/client/api.c
@@ -217,7 +217,7 @@ remctl_new(void)
r->fd = INVALID_SOCKET;
r->host = NULL;
r->principal = NULL;
- r->context = NULL;
+ r->context = GSS_C_NO_CONTEXT;
r->error = NULL;
r->output = NULL;
return r;
@@ -319,6 +319,8 @@ remctl_open(struct remctl *r, const char *host, unsigned short port,
void
remctl_close(struct remctl *r)
{
+ OM_uint32 minor;
+
if (r != NULL) {
if (r->protocol > 1 && r->fd != -1)
internal_v2_quit(r);
@@ -330,6 +332,8 @@ remctl_close(struct remctl *r)
free(r->error);
if (r->output != NULL)
free(r->output);
+ if (r->context != GSS_C_NO_CONTEXT)
+ gss_delete_sec_context(&minor, &r->context, GSS_C_NO_BUFFER);
free(r);
}
socket_shutdown();