1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

common: Fix possible small memory leak in b64dec.c.

* common/b64dec.c (b64dec_finish): Always release TITLE.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2016-06-23 17:44:55 +02:00
parent e584d6468a
commit c229ba4d8b
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -243,10 +243,11 @@ b64dec_proc (struct b64state *state, void *buffer, size_t length,
gpg_error_t gpg_error_t
b64dec_finish (struct b64state *state) b64dec_finish (struct b64state *state)
{ {
xfree (state->title);
state->title = NULL;
if (state->lasterr) if (state->lasterr)
return state->lasterr; return state->lasterr;
xfree (state->title);
state->title = NULL;
return state->invalid_encoding? gpg_error(GPG_ERR_BAD_DATA): 0; return state->invalid_encoding? gpg_error(GPG_ERR_BAD_DATA): 0;
} }