gpg: Eliminate a memory leak.
authorNeal H. Walfield <neal@g10code.com>
Thu, 29 Oct 2015 08:57:00 +0000 (09:57 +0100)
committerNeal H. Walfield <neal@g10code.com>
Thu, 29 Oct 2015 09:10:40 +0000 (10:10 +0100)
* g10/gpg.c (main): Don't leak OPT.DEF_RECIPIENT.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
g10/gpg.c

index c18edd0..0f1c74a 100644 (file)
--- 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;