From 55cbf105faac8ba03d61fbbcd0b6d391982134a3 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Wed, 28 Jan 2009 21:32:21 -0500 Subject: [PATCH] Fixed a segfault with the SAVE command when used with pinentry. Broke in commit fb0d289. --- src/commands.c | 3 --- src/pinentry.c | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/commands.c b/src/commands.c index 24e46311..30041236 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1140,9 +1140,6 @@ static gpg_error_t save_command_finalize(assuan_context_t ctx, guchar *key, if (do_compress(ctx, (gint)iter, xmlbuf, len, &outbuf, &outsize, &zrc) == FALSE) { - if (key != client->crypto->key) - gcry_free(key); - xmlFree(xmlbuf); cleanup_crypto(&client->crypto); diff --git a/src/pinentry.c b/src/pinentry.c index a8ef56bd..8fc6d78f 100644 --- a/src/pinentry.c +++ b/src/pinentry.c @@ -693,12 +693,10 @@ int pinentry_iterate(struct client_s *cl, gboolean read_ready) if (!shakey) pk.error = gpg_error_from_errno(ENOMEM); else { - pthread_cleanup_push(gcry_free, shakey); gcry_md_hash_buffer(GCRY_MD_SHA256, shakey, pk.what.key, strlen(pk.what.key) == 0 ? 1 : strlen(pk.what.key)); rc = cl->pinentry->cb(cl->ctx, shakey, FALSE); - pthread_cleanup_pop(1); } } } -- 2.11.4.GIT