diff options
author | Bodo Möller <bodo@openssl.org> | 2001-03-12 18:07:20 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2001-03-12 18:07:20 +0000 |
commit | f51cf14b85e489a8ab357fc16719efb711e76a1f (patch) | |
tree | e9b8a705f3fdeccc1d0be478586750a0ac71b366 | |
parent | 194dd04699f03af4cf7f7f88ecf31f243a19552b (diff) | |
download | openssl-f51cf14b85e489a8ab357fc16719efb711e76a1f.tar.gz |
fix memory leak in err.c
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | crypto/err/err.c | 10 |
2 files changed, 12 insertions, 1 deletions
@@ -3,6 +3,9 @@ Changes between 0.9.6 and 0.9.7 [xx XXX 2000] + *) Fix a memory leak in err.c: free err_data string if necessary. + [Bodo Moeller] + *) Function EC_POINTs_mul for simultaneous scalar multiplication of an arbitrary number of elliptic curve points, optionally including the generator defined for the EC_GROUP. 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) { |