From 1f78cb0b4dd193ec1f1b2b424a497a6c2edec043 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <dueno@redhat.com>
Date: Tue, 16 Oct 2018 18:16:51 +0200
Subject: [PATCH 08/36] rpc-server: p11_kit_remote_serve_tokens: Fix memleak

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

diff --git a/p11-kit/rpc-server.c b/p11-kit/rpc-server.c
index 3a8991d..5b3dbf0 100644
--- a/p11-kit/rpc-server.c
+++ b/p11-kit/rpc-server.c
@@ -2285,6 +2285,11 @@ p11_kit_remote_serve_tokens (const char **tokens,
 		p11_kit_modules_release (modules);
 	if (error != 0)
 		errno = error;
+	if (uris) {
+		for (i = 0; i < n_tokens; i++)
+			p11_kit_uri_free (uris[i]);
+		free (uris);
+	}
 
 	return ret;
 }
-- 
2.19.1

