diff options
author | Russ Allbery <rra@stanford.edu> | 2012-09-24 20:21:35 -0700 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2012-09-24 20:21:35 -0700 |
commit | 9d41004a7734e44b57691bec5b1ab628701eed74 (patch) | |
tree | b040f74b45d9dda6a149c115278b77d6c7129e08 /client | |
parent | d6a39b4573cc488c9f9147e7d778eeb3df30a62f (diff) |
Fix several client memory leaks
Fix several memory leaks when closing or reusing client connections in
libremctl.
Change-Id: I26e31d544e74d86a18aaa15f00ec32140b32ef37
Diffstat (limited to 'client')
-rw-r--r-- | client/api.c | 5 | ||||
-rw-r--r-- | client/client-v1.c | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/client/api.c b/client/api.c index 5cec897..67275b1 100644 --- a/client/api.c +++ b/client/api.c @@ -351,8 +351,11 @@ remctl_close(struct remctl *r) socket_close(r->fd); if (r->error != NULL) free(r->error); - if (r->output != NULL) + if (r->output != NULL) { + if (r->output->data != NULL) + free(r->output->data); free(r->output); + } if (r->context != GSS_C_NO_CONTEXT) gss_delete_sec_context(&minor, &r->context, GSS_C_NO_BUFFER); free(r); diff --git a/client/client-v1.c b/client/client-v1.c index b4f2c75..4fc50b8 100644 --- a/client/client-v1.c +++ b/client/client-v1.c @@ -179,6 +179,7 @@ internal_v1_output(struct remctl *r) * We can only do one round with protocol version one, so close the * connection now. */ + gss_delete_sec_context(&minor, &r->context, GSS_C_NO_BUFFER); socket_close(r->fd); r->fd = INVALID_SOCKET; r->ready = false; |