summaryrefslogtreecommitdiff
path: root/pkcs11/gkm
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2014-09-21 18:55:43 +0200
committerStef Walter <stefw@gnome.org>2014-10-14 17:55:45 +0200
commitbc17247fdd1fa843560ecebb4f20a10460df0d63 (patch)
treebc96004acb21693ccdb5bd1179e5e913a05010a3 /pkcs11/gkm
parent670fe30c2dfe7accc738c8def6c1ccf047c944b6 (diff)
downloadgnome-keyring-bc17247fdd1fa843560ecebb4f20a10460df0d63.tar.gz
Fix leak in gkm_mock_C_SetPIN()
https://bugzilla.gnome.org/show_bug.cgi?id=738508
Diffstat (limited to 'pkcs11/gkm')
-rw-r--r--pkcs11/gkm/gkm-mock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkcs11/gkm/gkm-mock.c b/pkcs11/gkm/gkm-mock.c
index 4ce9a996..6aaaff9e 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;