diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-05-16 04:57:49 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-05-16 04:57:49 +0000 |
commit | e2f9c4749114f7ddcd18e62e5559d0fa14bf0935 (patch) | |
tree | b03b48f1bbc38e03f1baab6f5a5575d2b8128caf /gdb/utils.c | |
parent | 56e290f494ab802bbc5c26c445dad0d1e6a7f37b (diff) | |
download | gdb-e2f9c4749114f7ddcd18e62e5559d0fa14bf0935.zip gdb-e2f9c4749114f7ddcd18e62e5559d0fa14bf0935.tar.gz gdb-e2f9c4749114f7ddcd18e62e5559d0fa14bf0935.tar.bz2 |
Make free_current_contents more robust. Use in MI.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index 3fd055ca..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 |