aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-08-18 20:22:27 +0000
committerMichael Snyder <msnyder@vmware.com>2007-08-18 20:22:27 +0000
commit31e9f6b6bee45795e02fa1d24c9e7c6454cc7098 (patch)
treef74cb521e57d840b1351c84db81989e623d11e0e
parent32107cd542eff63c06004408434cf337597fb2f1 (diff)
downloadgdb-31e9f6b6bee45795e02fa1d24c9e7c6454cc7098.zip
gdb-31e9f6b6bee45795e02fa1d24c9e7c6454cc7098.tar.gz
gdb-31e9f6b6bee45795e02fa1d24c9e7c6454cc7098.tar.bz2
2007-08-18 Michael Snyder <msnyder@svkmacdonelllnx>
* stabsread.c (dbx_lookup_type): Memory leak.
-rw-r--r--gdb/ChangeLog2
-rw-r--r--gdb/stabsread.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4ae9c5f..3ae0131 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,7 @@
2007-08-18 Michael Snyder <msnyder@svkmacdonelllnx>
+ * stabsread.c (dbx_lookup_type): Memory leak.
+
* event-loop.c (delete_async_signal_handler): Move pointer null
test to before pointer dereference.
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 678b3cf..d6cb915 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -283,15 +283,12 @@ dbx_lookup_type (int typenums[2])
if (real_filenum >= N_HEADER_FILES (current_objfile))
{
- struct type *temp_type;
- struct type **temp_type_p;
+ static struct type **temp_type_p;
warning (_("GDB internal error: bad real_filenum"));
error_return:
- temp_type = init_type (TYPE_CODE_ERROR, 0, 0, NULL, NULL);
- temp_type_p = (struct type **) xmalloc (sizeof (struct type *));
- *temp_type_p = temp_type;
+ temp_type_p = &builtin_type_error;
return temp_type_p;
}