[gnome-keyring] Fix leak in gkm_mock_C_SetPIN()



commit bc17247fdd1fa843560ecebb4f20a10460df0d63
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Sun Sep 21 18:55:43 2014 +0200

    Fix leak in gkm_mock_C_SetPIN()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738508

 pkcs11/gkm/gkm-mock.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/pkcs11/gkm/gkm-mock.c b/pkcs11/gkm/gkm-mock.c
index 4ce9a99..6aaaff9 100644
--- a/pkcs11/gkm/gkm-mock.c
+++ b/pkcs11/gkm/gkm-mock.c
@@ -679,9 +679,12 @@ gkm_mock_C_SetPIN (CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pOldPin,
        g_return_val_if_fail (session, CKR_SESSION_HANDLE_INVALID);
 
        old = g_strndup ((gchar*)pOldPin, ulOldLen);
-       if (!old || !g_str_equal (old, the_pin))
+       if (!old || !g_str_equal (old, the_pin)) {
+               g_free (old);
                return CKR_PIN_INCORRECT;
+       }
 
+       g_free (old);
        g_free (the_pin);
        the_pin = g_strndup ((gchar*)pNewPin, ulNewLen);
        n_the_pin = ulNewLen;


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