summaryrefslogtreecommitdiff
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, 3 insertions, 4 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 3a05680161e..fdc486dc1b5 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -291,8 +291,7 @@ restore_integer (void *p)
struct cleanup *
make_cleanup_restore_integer (int *variable)
{
- struct restore_integer_closure *c =
- xmalloc (sizeof (struct restore_integer_closure));
+ struct restore_integer_closure *c = XNEW (struct restore_integer_closure);
c->variable = variable;
c->value = *variable;
@@ -860,8 +859,8 @@ add_internal_problem_command (struct internal_problem *problem)
char *set_doc;
char *show_doc;
- set_cmd_list = xmalloc (sizeof (*set_cmd_list));
- show_cmd_list = xmalloc (sizeof (*set_cmd_list));
+ set_cmd_list = XNEW (struct cmd_list_element *);
+ show_cmd_list = XNEW (struct cmd_list_element *);
*set_cmd_list = NULL;
*show_cmd_list = NULL;