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>
This commit is contained in:
David Benjamin 2014-11-02 20:47:17 -05:00 committed by Adam Langley
parent e2793a7189
commit 4aa86f1cdf

View File

@ -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;
}