[Pkg-gnupg-commit] [gnupg2] 83/124: g10: Fix memory leak.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Apr 5 15:55:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit 6d3edfd972c1114f43f6b35773dc25e0256f48f4
Author: Justus Winter <justus at g10code.com>
Date:   Tue Mar 28 12:10:28 2017 +0200

    g10: Fix memory leak.
    
    * g10/decrypt-data.c (decrypt_data): Free 'filename'.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 g10/decrypt-data.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/g10/decrypt-data.c b/g10/decrypt-data.c
index 11a253f..96e2487 100644
--- a/g10/decrypt-data.c
+++ b/g10/decrypt-data.c
@@ -222,7 +222,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
 
   if (opt.unwrap_encryption)
     {
-      char *filename;
+      char *filename = NULL;
       estream_t fp;
       rc = get_output_file ("", 0, ed->buf, &filename, &fp);
       if (! rc)
@@ -248,6 +248,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
           if (afx)
             release_armor_context (afx);
         }
+      xfree (filename);
     }
   else
     proc_packets (ctrl, procctx, ed->buf );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list