json: Fix double ctx alloc

* src/gpgme-json.c (op_keylist): Only get one ctx.
This commit is contained in:
Andre Heinecke 2018-05-25 14:50:59 +02:00
parent 10683b1a91
commit 897522527d
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -1966,9 +1966,6 @@ op_keylist (cjson_t request, cjson_t result)
patterns = create_keylist_patterns (request); patterns = create_keylist_patterns (request);
/* Do a keylisting and add the keys */ /* Do a keylisting and add the keys */
if ((err = gpgme_new (&ctx)))
goto leave;
gpgme_set_protocol (ctx, protocol);
gpgme_set_keylist_mode (ctx, mode); gpgme_set_keylist_mode (ctx, mode);
err = gpgme_op_keylist_ext_start (ctx, (const char **) patterns, err = gpgme_op_keylist_ext_start (ctx, (const char **) patterns,