summaryrefslogtreecommitdiffstats
path: root/g10/gpg.c
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@g10code.com>2015-10-29 09:57:00 +0100
committerNeal H. Walfield <neal@g10code.com>2015-10-29 10:10:40 +0100
commit89eee5f6b7ca3da7ebdcc3e5d069701d0834b39e (patch)
tree9b56d2a7899eeb2489b6395bdabea5e6ec98a285 /g10/gpg.c
parentgpg: Fix keyring support. (diff)
downloadgnupg2-89eee5f6b7ca3da7ebdcc3e5d069701d0834b39e.tar.xz
gnupg2-89eee5f6b7ca3da7ebdcc3e5d069701d0834b39e.zip
gpg: Eliminate a memory leak.
* g10/gpg.c (main): Don't leak OPT.DEF_RECIPIENT. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>
Diffstat (limited to '')
-rw-r--r--g10/gpg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index c18edd0dd..0f1c74a9d 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -2580,7 +2580,10 @@ main (int argc, char **argv)
case oDefaultKey: opt.def_secret_key = pargs.r.ret_str; break;
case oDefRecipient:
if( *pargs.r.ret_str )
- opt.def_recipient = make_username(pargs.r.ret_str);
+ {
+ xfree (opt.def_recipient);
+ opt.def_recipient = make_username(pargs.r.ret_str);
+ }
break;
case oDefRecipientSelf:
xfree(opt.def_recipient); opt.def_recipient = NULL;