gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_12_1-43-g866c0


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_12_1-43-g866c0cd
Date: Fri, 08 Apr 2011 15:40:12 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=866c0cd1d76864f12e0a238fcf52d38bbf1b64ef

The branch, gnutls_2_12_x has been updated
       via  866c0cd1d76864f12e0a238fcf52d38bbf1b64ef (commit)
       via  cac89ca4d2dd56d2c7cd289ee6956ecf4570dc6b (commit)
      from  3dc56f59d5a00e4766e475c9db00b28ccca64aad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 866c0cd1d76864f12e0a238fcf52d38bbf1b64ef
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Apr 8 17:17:24 2011 +0200

    more leaks fixed in common.c

commit cac89ca4d2dd56d2c7cd289ee6956ecf4570dc6b
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Apr 8 17:08:54 2011 +0200

    Corrected leaks in gnutls_pubkey_t deinitialization.

-----------------------------------------------------------------------

Summary of changes:
 lib/gnutls_pubkey.c |    7 +++++++
 lib/x509/common.c   |   18 ++++--------------
 2 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/lib/gnutls_pubkey.c b/lib/gnutls_pubkey.c
index 0075f39..1775a62 100644
--- a/lib/gnutls_pubkey.c
+++ b/lib/gnutls_pubkey.c
@@ -147,6 +147,13 @@ gnutls_pubkey_init (gnutls_pubkey_t * key)
 void
 gnutls_pubkey_deinit (gnutls_pubkey_t key)
 {
+int i;
+
+  for (i = 0; i < key->params_size; i++)
+    {
+      _gnutls_mpi_release (&key->params[i]);
+    }
+
   gnutls_free (key);
 }
 
diff --git a/lib/x509/common.c b/lib/x509/common.c
index 5119cbe..80af4a0 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -1112,14 +1112,6 @@ _gnutls_x509_write_value (ASN1_TYPE c, const char *root,
     {
       /* Convert it to OCTET STRING
        */
-      val.data = gnutls_malloc (asize);
-      if (val.data == NULL)
-        {
-          gnutls_assert ();
-          result = GNUTLS_E_MEMORY_ERROR;
-          goto cleanup;
-        }
-
       if ((result = asn1_create_element
            (_gnutls_get_pkix (), "PKIX1.pkcs-7-Data", &c2)) != ASN1_SUCCESS)
         {
@@ -1153,19 +1145,17 @@ _gnutls_x509_write_value (ASN1_TYPE c, const char *root,
   /* Write the data.
    */
   result = asn1_write_value (c, root, val.data, val.size);
-
-  if (val.data != data->data)
-    _gnutls_free_datum (&val);
-
   if (result != ASN1_SUCCESS)
     {
       gnutls_assert ();
-      return _gnutls_asn2err (result);
+      result = _gnutls_asn2err (result);
+      goto cleanup;
     }
 
-  return 0;
+  result = 0;
 
 cleanup:
+  asn1_delete_structure (&c2);
   if (val.data != data->data)
     _gnutls_free_datum (&val);
   return result;


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]