aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 3fd055c..45fdb1d 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -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