diff --git a/crypto/err/err.c b/crypto/err/err.c index d0425d8fc..6b3d97820 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; }