common: Fix possible small memory leak in b64dec.c.
authorWerner Koch <wk@gnupg.org>
Thu, 23 Jun 2016 15:44:55 +0000 (17:44 +0200)
committerWerner Koch <wk@gnupg.org>
Thu, 23 Jun 2016 18:01:15 +0000 (20:01 +0200)
* common/b64dec.c (b64dec_finish): Always release TITLE.

Signed-off-by: Werner Koch <wk@gnupg.org>
common/b64dec.c

index 9e8fb78..c84c35a 100644 (file)
@@ -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;
 }