diff options
author | Stef Walter <stefw@gnome.org> | 2013-03-20 22:20:25 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2013-03-20 22:22:30 +0100 |
commit | 4b09d2b4d3958b58b020c1ae21fcd932e1eb6c37 (patch) | |
tree | abba9eb25d2d7d4c9804ba56741e08e40b0fe417 /p11-kit | |
parent | 57d8f36a6cfbde5a9a783f11f2b75f19005c23e1 (diff) |
Fix memory leaks reported by 'make leakcheck'
Diffstat (limited to 'p11-kit')
-rw-r--r-- | p11-kit/iter.c | 3 | ||||
-rw-r--r-- | p11-kit/tests/pin-test.c | 1 | ||||
-rw-r--r-- | p11-kit/tests/test-iter.c | 1 | ||||
-rw-r--r-- | p11-kit/tests/test-modules.c | 2 | ||||
-rw-r--r-- | p11-kit/uri.c | 5 |
5 files changed, 7 insertions, 5 deletions
diff --git a/p11-kit/iter.c b/p11-kit/iter.c index 7f23c53..c144165 100644 --- a/p11-kit/iter.c +++ b/p11-kit/iter.c @@ -815,6 +815,7 @@ p11_kit_iter_free (P11KitIter *iter) finish_iterating (iter, CKR_OK); p11_array_free (iter->modules); p11_attrs_free (iter->match_attrs); + free (iter->slots); for (cb = iter->callbacks; cb != NULL; cb = next) { next = cb->next; @@ -822,4 +823,6 @@ p11_kit_iter_free (P11KitIter *iter) (cb->destroyer) (cb->callback_data); free (cb); } + + free (iter); } diff --git a/p11-kit/tests/pin-test.c b/p11-kit/tests/pin-test.c index 758acf4..dd020bc 100644 --- a/p11-kit/tests/pin-test.c +++ b/p11-kit/tests/pin-test.c @@ -109,7 +109,6 @@ test_pin_read (CuTest *tc) p11_kit_pin_unregister_callback ("/the/pin_source", callback_one, &data); - p11_kit_pin_ref (pin); p11_kit_pin_unref (pin); } diff --git a/p11-kit/tests/test-iter.c b/p11-kit/tests/test-iter.c index 81aa06c..ccfce2c 100644 --- a/p11-kit/tests/test-iter.c +++ b/p11-kit/tests/test-iter.c @@ -983,6 +983,7 @@ test_load_attributes_none (CuTest *tc) attrs = p11_attrs_buildn (NULL, NULL, 0); rv = p11_kit_iter_load_attributes (iter, attrs, 0); CuAssertTrue (tc, rv == CKR_OK); + p11_attrs_free (attrs); } CuAssertTrue (tc, rv == CKR_CANCEL); diff --git a/p11-kit/tests/test-modules.c b/p11-kit/tests/test-modules.c index 5bdbaa4..3f0e4e0 100644 --- a/p11-kit/tests/test-modules.c +++ b/p11-kit/tests/test-modules.c @@ -96,6 +96,8 @@ test_no_duplicates (CuTest *tc) CuAssert (tc, "shouldn't be reached", 0); if (!p11_dict_set (paths, path, "")) CuAssert (tc, "shouldn't be reached", 0); + + free (path); } p11_dict_free (paths); diff --git a/p11-kit/uri.c b/p11-kit/uri.c index 0bb35db..52bd61d 100644 --- a/p11-kit/uri.c +++ b/p11-kit/uri.c @@ -922,10 +922,7 @@ parse_class_attribute (const char *name, const char *start, const char *end, free (value); - attr.pValue = malloc (sizeof (klass)); - return_val_if_fail (attr.pValue != NULL, P11_KIT_URI_UNEXPECTED); - - memcpy (attr.pValue, &klass, sizeof (klass)); + attr.pValue = &klass; attr.ulValueLen = sizeof (klass); attr.type = CKA_CLASS; |