diff --git a/crypto/err/err.c b/crypto/err/err.c index 91b0295fb5..06d1ef9c4a 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -468,10 +468,9 @@ static unsigned long get_error_values(int inc, const char **file, int *line, if (data == NULL) { - if (inc && (es->err_data[i] != NULL) && (es->err_data_flags[i] & ERR_TXT_MALLOCED)) + if (inc) { - OPENSSL_free(es->err_data[i]); - es->err_data[i] = NULL; + err_clear_data(es, i); } } else