diff options
author | Daiki Ueno <dueno@redhat.com> | 2018-02-26 14:51:43 +0100 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2018-02-27 12:27:45 +0100 |
commit | 47297f9785a21af1bb79450bad549aa8bd33a24c (patch) | |
tree | 1d304b43c19cd976b64d13b3108b0783ced7dca3 /p11-kit | |
parent | 7a018706b54e09f1cc7ce8c6d1ceaecf28b7308b (diff) |
client: Fix memleaks in the module
Diffstat (limited to 'p11-kit')
-rw-r--r-- | p11-kit/client.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/p11-kit/client.c b/p11-kit/client.c index 26b2e74..698a8c3 100644 --- a/p11-kit/client.c +++ b/p11-kit/client.c @@ -186,14 +186,19 @@ C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) state->rpc = p11_rpc_transport_new (&state->virt, address, "client"); - if (!state->rpc) + if (!state->rpc) { + free (state); rv = CKR_GENERAL_ERROR; + } } if (rv == CKR_OK) { - module = p11_virtual_wrap (&state->virt, free); - if (!module) + module = p11_virtual_wrap (&state->virt, (p11_destroyer)p11_virtual_uninit); + if (!module) { + p11_rpc_transport_free (state->rpc); + free (state); rv = CKR_GENERAL_ERROR; + } } if (rv == CKR_OK) { @@ -222,5 +227,6 @@ p11_client_module_cleanup (void) next = state->next; p11_rpc_transport_free (state->rpc); p11_virtual_unwrap (state->wrapped); + free (state); } } |