summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPankaj <pankaj.s01@samsung.com>2016-09-20 18:06:17 +0200
committerDaiki Ueno <ueno@gnu.org>2016-12-13 10:13:41 +0100
commit873e52cc72701f7a5714a5006f15810ba5981d10 (patch)
tree4ad30fb582d7a3ec9e477c81e24b172189234123
parent2cf22900bbcb3a0f3d11b56ad262bef33e997a00 (diff)
proxy: Check return value of calloc()
https://bugs.freedesktop.org/show_bug.cgi?id=92815
-rw-r--r--p11-kit/proxy.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/p11-kit/proxy.c b/p11-kit/proxy.c
index c554511..77e70c0 100644
--- a/p11-kit/proxy.c
+++ b/p11-kit/proxy.c
@@ -580,6 +580,7 @@ proxy_C_OpenSession (CK_X_FUNCTION_LIST *self,
} else {
sess = calloc (1, sizeof (Session));
+ return_val_if_fail (sess != NULL, CKR_HOST_MEMORY);
sess->wrap_slot = map.wrap_slot;
sess->real_session = *handle;
sess->wrap_session = ++state->last_handle; /* TODO: Handle wrapping, and then collisions */