summaryrefslogtreecommitdiffstats
path: root/g10/revoke.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2011-09-20 16:26:37 +0200
committerWerner Koch <wk@gnupg.org>2011-09-20 18:12:07 +0200
commitb8b4d5c9e55c73b2a2f0f3b5aee292de2bb0b512 (patch)
tree42af054d65dea20526e059c2090bc0480154e286 /g10/revoke.c
parentReplace gcry_md_start_debug by gcry_md_debug. (diff)
downloadgnupg2-b8b4d5c9e55c73b2a2f0f3b5aee292de2bb0b512.tar.xz
gnupg2-b8b4d5c9e55c73b2a2f0f3b5aee292de2bb0b512.zip
avoid use of freed pointer
Without this patch, pk2 would be freed twice. >From 2a18a4b757e0896e738fefbbaa8ff8c23a9edf89 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 20 Sep 2011 16:20:39 +0200 Subject: [PATCH] avoid use of freed pointer If we free pk2 at the top of the for-loop, set it to NULL so that we don't free it again just before returning. * revoke.c (gen_desig_revoke): Don't use pk2 after freeing it.
Diffstat (limited to 'g10/revoke.c')
-rw-r--r--g10/revoke.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/g10/revoke.c b/g10/revoke.c
index c18dfb989..2c696cc9c 100644
--- a/g10/revoke.c
+++ b/g10/revoke.c
@@ -263,7 +263,10 @@ gen_desig_revoke( const char *uname, strlist_t locusr )
SK_LIST list;
if (pk2)
- free_public_key (pk2);
+ {
+ free_public_key (pk2);
+ pk2 = NULL;
+ }
if(sk_list)
{