From f51cf14b85e489a8ab357fc16719efb711e76a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bodo=20M=C3=B6ller?= Date: Mon, 12 Mar 2001 18:07:20 +0000 Subject: fix memory leak in err.c --- crypto/err/err.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'crypto/err') diff --git a/crypto/err/err.c b/crypto/err/err.c index 145fdc58d1..91b0295fb5 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -466,7 +466,15 @@ static unsigned long get_error_values(int inc, const char **file, int *line, } } - if (data != NULL) + if (data == NULL) + { + if (inc && (es->err_data[i] != NULL) && (es->err_data_flags[i] & ERR_TXT_MALLOCED)) + { + OPENSSL_free(es->err_data[i]); + es->err_data[i] = NULL; + } + } + else { if (es->err_data[i] == NULL) { -- cgit v1.2.3