]> granicus.if.org Git - p11-kit/commitdiff
trust: Fix memleak in p11_enumerate_opt_filter
authorDaiki Ueno <dueno@redhat.com>
Tue, 10 Apr 2018 07:47:06 +0000 (09:47 +0200)
committerDaiki Ueno <ueno@gnu.org>
Tue, 10 Apr 2018 15:57:11 +0000 (17:57 +0200)
p11_kit_iter_add_filter() takes the ownership of given attributes.
Spotted by address sanitizer.

trust/enumerate.c

index 9b43b9b58a6c7c214c07b659cb73f1167e54e1e9..e197765fd0777fb161b0048051ef63e478262b65 100644 (file)
@@ -613,6 +613,7 @@ p11_enumerate_opt_filter (p11_enumerate *ex,
        }
 
        p11_kit_iter_add_filter (ex->iter, attrs, p11_attrs_count (attrs));
+       p11_attrs_free (attrs);
        ex->num_filters++;
        return true;
 }