Package: gnutls26 / 2.12.20-8+deb7u5

34_pkcs11_memleak.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 433bc2bdc118ac3b8a83a5fb7d41b3cecdd73cc9 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Sun, 3 Feb 2013 13:13:34 -0500
Subject: [PATCH 1/6] free allocated module name. Reported by Sam Varshavchik.

This is the same fix from the 3.0 branch as:

 ce7caadb  "free allocated module name. Reported by Sam Varshavchik."

** libgnutls: Eliminated memory leak in PCKS #11 initialization.
Report and fix by Sam Varshavchik.

diff --git a/lib/pkcs11.c b/lib/pkcs11.c
index 59cf686..2bf6b04 100644
--- a/lib/pkcs11.c
+++ b/lib/pkcs11.c
@@ -441,7 +441,7 @@ static int
 initialize_automatic_p11_kit (void)
 {
   struct ck_function_list **modules;
-  const char *name;
+  char *name;
   ck_rv_t rv;
   int i, ret;
 
@@ -466,6 +466,7 @@ initialize_automatic_p11_kit (void)
           gnutls_assert ();
           _gnutls_debug_log ("Cannot add registered module: %s\n", name);
         }
+      free(name);
     }
 
   free (modules);
-- 
1.7.10.4