fix memory leak in err.c
This commit is contained in:
parent
142e22641e
commit
2c89d56a1d
2 changed files with 12 additions and 1 deletions
3
CHANGES
3
CHANGES
|
@ -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]
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue