[git] GnuPG - branch, master, updated. gnupg-2.2.7-215-gfe8b633

by NIIBE Yutaka cvs at cvs.gnupg.org
Tue Sep 18 02:49:17 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  fe8b6339542f3b1228b5fd56fc710ea3b07a3a2b (commit)
      from  60c880bda5c9b821fd2968cf89c38c37be3c1a7b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fe8b6339542f3b1228b5fd56fc710ea3b07a3a2b
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Tue Sep 18 09:34:00 2018 +0900

    g10: Fix memory leak for --card-status.
    
    * g10/card-util.c (card_status): Release memory of serial number.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/card-util.c b/g10/card-util.c
index e9c0120..779e9d8 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -674,7 +674,7 @@ card_status (ctrl_t ctrl, estream_t fp, const char *serialno)
 {
   int err;
   strlist_t card_list, sl;
-  char *serialno0;
+  char *serialno0, *serialno1;
   int all_cards = 0;
 
   if (serialno == NULL)
@@ -700,8 +700,6 @@ card_status (ctrl_t ctrl, estream_t fp, const char *serialno)
 
   for (sl = card_list; sl; sl = sl->next)
     {
-      char *serialno1;
-
       if (!all_cards && strcmp (serialno, sl->d))
         continue;
 
@@ -722,7 +720,8 @@ card_status (ctrl_t ctrl, estream_t fp, const char *serialno)
     }
 
   /* Select the original card again.  */
-  err = agent_scd_serialno (&serialno0, serialno0);
+  err = agent_scd_serialno (&serialno1, serialno0);
+  xfree (serialno1);
 
  leave:
   xfree (serialno0);

-----------------------------------------------------------------------

Summary of changes:
 g10/card-util.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list