aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/regcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver/regcache.c')
-rw-r--r--gdb/gdbserver/regcache.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index ef955ff..59bdc53 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -159,11 +159,10 @@ init_register_cache (struct regcache *regcache,
struct regcache *
new_register_cache (const struct target_desc *tdesc)
{
- struct regcache *regcache;
+ struct regcache *regcache = XCNEW (struct regcache);
gdb_assert (tdesc->registers_size != 0);
- regcache = xmalloc (sizeof (*regcache));
return init_register_cache (regcache, tdesc, NULL);
}