From 6417780ebbbbb0f01ddb001b239347655fb98578 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <dueno@redhat.com>
Date: Wed, 17 Oct 2018 09:53:27 +0200
Subject: [PATCH 11/36] rpc-server: Check calloc failure

---
 p11-kit/rpc-server.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/p11-kit/rpc-server.c b/p11-kit/rpc-server.c
index 5b3dbf0..3216742 100644
--- a/p11-kit/rpc-server.c
+++ b/p11-kit/rpc-server.c
@@ -2219,6 +2219,10 @@ p11_kit_remote_serve_tokens (const char **tokens,
 		filter = p11_dict_get (filters, module);
 		if (filter == NULL) {
 			lower = calloc (1, sizeof (p11_virtual));
+			if (lower == NULL) {
+				error = ENOMEM;
+				goto out;
+			}
 			p11_virtual_init (lower, &p11_virtual_base, module, NULL);
 			filter = p11_filter_subclass (lower, NULL);
 			if (filter == NULL) {
-- 
2.19.1

