diff options
author | Werner Koch <wk@gnupg.org> | 2016-06-23 17:44:55 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2016-06-23 20:01:15 +0200 |
commit | c229ba4d8b9b16052ee0b9573bed7905be602cdf (patch) | |
tree | 4118e0b9cc02a46cc3fc3e72931dd26ff872f4c2 /common/b64dec.c | |
parent | tests/openpgp: Fake the system time for the tofu test. (diff) | |
download | gnupg2-c229ba4d8b9b16052ee0b9573bed7905be602cdf.tar.xz gnupg2-c229ba4d8b9b16052ee0b9573bed7905be602cdf.zip |
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>
Diffstat (limited to 'common/b64dec.c')
-rw-r--r-- | common/b64dec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/b64dec.c b/common/b64dec.c index 9e8fb7857..c84c35ada 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; } |