[gnome-keyring] gkm-data-asn1: Unref buffer we got from egg_asn1x_get_integer_as_raw()



commit c5083ba0216b15e8f9ed842b7097e7fa6c60c25b
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Wed Sep 17 11:53:30 2014 +0200

    gkm-data-asn1: Unref buffer we got from egg_asn1x_get_integer_as_raw()
    
    Otherwise we will be leaking a reference to that buffer, and it will
    never get destroyed. This showed up as a memory leaked in test-data-der.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738508

 pkcs11/gkm/gkm-data-asn1.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/pkcs11/gkm/gkm-data-asn1.c b/pkcs11/gkm/gkm-data-asn1.c
index e8c88e4..e063dd4 100644
--- a/pkcs11/gkm/gkm-data-asn1.c
+++ b/pkcs11/gkm/gkm-data-asn1.c
@@ -43,6 +43,7 @@ gkm_data_asn1_read_mpi (GNode *asn, gcry_mpi_t *mpi)
        /* Automatically stores in secure memory if DER data is secure */
        sz = g_bytes_get_size (buf);
        gcry = gcry_mpi_scan (mpi, GCRYMPI_FMT_STD, g_bytes_get_data (buf, NULL), sz, &sz);
+       g_bytes_unref (buf);
        if (gcry != 0)
                return FALSE;
 


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