summaryrefslogtreecommitdiff
path: root/p11-kit/proxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'p11-kit/proxy.c')
-rw-r--r--p11-kit/proxy.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/p11-kit/proxy.c b/p11-kit/proxy.c
index b7fb63d..abe7935 100644
--- a/p11-kit/proxy.c
+++ b/p11-kit/proxy.c
@@ -267,7 +267,10 @@ proxy_create (Proxy **res, CK_FUNCTION_LIST **loaded,
py->forkid = p11_forkid;
py->inited = modules_dup (loaded);
- return_val_if_fail (py->inited != NULL, CKR_HOST_MEMORY);
+ if (py->inited == NULL) {
+ proxy_free (py, 0);
+ return_val_if_reached (CKR_HOST_MEMORY);
+ }
rv = p11_kit_modules_initialize (py->inited, NULL);
@@ -320,7 +323,10 @@ proxy_create (Proxy **res, CK_FUNCTION_LIST **loaded,
}
py->sessions = p11_dict_new (p11_dict_ulongptr_hash, p11_dict_ulongptr_equal, NULL, free);
- return_val_if_fail (py->sessions != NULL, CKR_HOST_MEMORY);
+ if (py->sessions == NULL) {
+ proxy_free (py, 1);
+ return_val_if_reached (CKR_HOST_MEMORY);
+ }
py->refs = 1;
*res = py;