[git] GnuPG - branch, master, updated. gnupg-2.1.16-34-g52385a2

by Justus Winter cvs at cvs.gnupg.org
Tue Nov 29 16:50:49 CET 2016


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  52385a2ba1bf7e53f500ffde5fd34f28e69cf76b (commit)
      from  9fb5e9c14557f7567cbc7c50b9881b7d7bfa2f12 (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 52385a2ba1bf7e53f500ffde5fd34f28e69cf76b
Author: Justus Winter <justus at g10code.com>
Date:   Tue Nov 29 16:48:35 2016 +0100

    g10: Fix memory leak.
    
    * g10/decrypt.c (decrypt_messages): Properly decrease the reference
    count of the armor filters after pushing them.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/decrypt.c b/g10/decrypt.c
index 751b7be..c99f064 100644
--- a/g10/decrypt.c
+++ b/g10/decrypt.c
@@ -180,7 +180,6 @@ void
 decrypt_messages (ctrl_t ctrl, int nfiles, char *files[])
 {
   IOBUF fp;
-  armor_filter_context_t *afx = NULL;
   progress_filter_context_t *pfx;
   char *p, *output = NULL;
   int rc=0,use_stdin=0;
@@ -254,8 +253,11 @@ decrypt_messages (ctrl_t ctrl, int nfiles, char *files[])
         {
           if (use_armor_filter(fp))
             {
-              afx = new_armor_context ();
-              push_armor_filter ( afx, fp );
+              armor_filter_context_t *afx = new_armor_context ();
+              rc = push_armor_filter (afx, fp);
+              if (rc)
+                log_error("failed to push armor filter");
+              release_armor_context (afx);
             }
         }
       rc = proc_packets (ctrl,NULL, fp);
@@ -275,6 +277,5 @@ decrypt_messages (ctrl_t ctrl, int nfiles, char *files[])
     }
 
   set_next_passphrase(NULL);
-  release_armor_context (afx);
   release_progress_context (pfx);
 }

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

Summary of changes:
 g10/decrypt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)


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




More information about the Gnupg-commits mailing list