Make free_current_contents more robust. Use in MI.

This commit is contained in:
Andrew Cagney 2000-05-16 04:57:49 +00:00
parent 56e290f494
commit e2f9c47491
4 changed files with 16 additions and 10 deletions

View file

@ -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