[Pkg-gnupg-commit] [gnupg2] 87/160: tools: Fix trivial memory leak.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Jul 15 09:36:39 UTC 2016


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

dkg pushed a commit to branch upstream
in repository gnupg2.

commit 8f39185d7bfa0bc749f9ccf4a041d2da4eba24ff
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 30 13:53:12 2016 +0200

    tools: Fix trivial memory leak.
    
    * tools/gpg-connect-agent.c (main): Fix trivial memory leak.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 tools/gpg-connect-agent.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index 1cd554f..6b5f507 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -1879,6 +1879,16 @@ main (int argc, char **argv)
   if (opt.verbose)
     log_info ("closing connection to agent\n");
 
+  /* XXX: We would like to release the context here, but libassuan
+     nicely says good bye to the server, which results in a SIGPIPE if
+     the server died.  Unfortunately, libassuan does not ignore
+     SIGPIPE when used with UNIX sockets, hence we simply leak the
+     context here.  */
+  if (0)
+    assuan_release (ctx);
+  else
+    gpgrt_annotate_leaked_object (ctx);
+  xfree (line);
   return 0;
 }
 

-- 
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