[Pkg-gnupg-commit] [gnupg2] 49/160: common: Fix possible small memory leak in b64dec.c.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Jul 15 09:36:35 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 c229ba4d8b9b16052ee0b9573bed7905be602cdf
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Jun 23 17:44:55 2016 +0200

    common: Fix possible small memory leak in b64dec.c.
    
    * common/b64dec.c (b64dec_finish): Always release TITLE.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>
---
 common/b64dec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/b64dec.c b/common/b64dec.c
index 9e8fb78..c84c35a 100644
--- a/common/b64dec.c
+++ b/common/b64dec.c
@@ -243,10 +243,11 @@ b64dec_proc (struct b64state *state, void *buffer, size_t length,
 gpg_error_t
 b64dec_finish (struct b64state *state)
 {
+  xfree (state->title);
+  state->title = NULL;
+
   if (state->lasterr)
     return state->lasterr;
 
-  xfree (state->title);
-  state->title = NULL;
   return state->invalid_encoding? gpg_error(GPG_ERR_BAD_DATA): 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