diff options
author | David Benjamin <davidben@chromium.org> | 2014-11-03 04:47:17 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-11-06 04:35:26 +0300 |
commit | 4aa86f1cdf4e1ad2589dca916761e9674a46f4a5 (patch) | |
tree | 1686645b319e661af8704845626128bcc0855d9a /crypto/err/err.c | |
parent | e2793a7189f6b093f61a7dde6e7db48c656bf6ff (diff) |
Don't leak in err_set_error_data if error queue is empty.
Caught by clang scan-build.
Change-Id: I16496bfc469e809348199057adfb24c33c426ccb
Reviewed-on: https://boringssl-review.googlesource.com/2207
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/err/err.c')
-rw-r--r-- | crypto/err/err.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c index d0425d8f..6b3d9782 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -474,6 +474,9 @@ static void err_set_error_data(char *data, int flags) { struct err_error_st *error; if (state->top == state->bottom) { + if (flags & ERR_FLAG_MALLOCED) { + OPENSSL_free(data); + } return; } |