minor memory leak in libgnutls26 pkcs11 initialization

Daniel Kahn Gillmor dkg at fifthhorseman.net
Sun Feb 3 18:41:27 UTC 2013


Hi debian GnuTLS folks--

the following patch fixes a minor memory leak in GnuTLS's pkcs11
initialization.

It is already fixed in libgnutls28 and i've just pushed it into the
2.12.x development branch upstream, so hopefully it will be in 2.12.23
whenever that comes out.

Fixing this leak in debian will make it easier to use tools like
valgrind on programs that use libgnutls26 without getting spurious error
reports.

I'm not particularly clear how the pkg-gnutls-maint team is using svn
with multiple branches (e.g. i don't see a branch for the version
currently in sid or wheezy), but if someone wants to point me to the
team's best practices, i could make a try at applying this fix myself in
svn.

I'm also happy to just report it and have someone else deal with the
packaging questions :)

Thanks for all the work on GnuTLS in debian!

Regards,

         --dkg

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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 965 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnutls-maint/attachments/20130203/bda46e70/attachment.pgp>


More information about the Pkg-gnutls-maint mailing list