commit 9270dc32a7f5754a42a66754937f5da43faf48d2
parent cc91e29fb4d18737d648ae2112063440e1cdcc0f
Author: Colin Leroy <colin@colino.net>
Date: Mon, 18 Sep 2017 10:09:52 +0200
Fix a possible leak
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/plugins/pgpcore/select-keys.c b/src/plugins/pgpcore/select-keys.c
@@ -302,8 +302,10 @@ fill_clist (struct select_keys_s *sk, const char *pattern, gpgme_protocol_t prot
update_progress (sk, ++running, pattern);
while ( !(err = gpgme_op_keylist_next ( ctx, &key )) ) {
gpgme_user_id_t uid = key->uids;
- if (!key->can_encrypt || key->revoked || key->expired || key->disabled)
+ if (!key->can_encrypt || key->revoked || key->expired || key->disabled) {
+ gpgme_key_unref(key);
continue;
+ }
debug_print ("%% %s:%d: insert\n", __FILE__ ,__LINE__ );
set_row (clist, key, proto );
for (; uid; uid = uid->next) {