Make free_current_contents more robust. Use in MI.
This commit is contained in:
parent
56e290f494
commit
e2f9c47491
4 changed files with 16 additions and 10 deletions
|
@ -390,8 +390,13 @@ void
|
|||
free_current_contents (void *ptr)
|
||||
{
|
||||
void **location = ptr;
|
||||
if (location == NULL)
|
||||
internal_error ("free_current_contents: NULL pointer");
|
||||
if (*location != NULL)
|
||||
free (*location);
|
||||
{
|
||||
free (*location);
|
||||
*location = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Provide a known function that does nothing, to use as a base for
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue