fix memory leak in err.c

This commit is contained in:
Bodo Möller 2001-03-12 18:39:47 +00:00
parent 142e22641e
commit 2c89d56a1d
2 changed files with 12 additions and 1 deletions

View file

@ -4,6 +4,9 @@
Changes between 0.9.6 and 0.9.6a [xx XXX 2001]
*) Fix a memory leak in err.c: free err_data string if necessary.
[Bodo Moeller]
*) Implement ssl23_peek (analogous to ssl23_read), which previously
did not exist.
[Bodo Moeller]

View file

@ -462,7 +462,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)
{