]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/cli/cli-setshow.c
Replace some xmalloc-family functions with XNEW-family ones
[thirdparty/binutils-gdb.git] / gdb / cli / cli-setshow.c
index 8d01b52472d293fc43fac69c44226b083ce77a53..ca41d8e5bb58c2678add4cda66bb7a81780a3191 100644 (file)
@@ -475,8 +475,8 @@ do_set_command (const char *arg, int from_tty, struct cmd_list_element *c)
 
          p = p->prefix;
        }
-      cp = name = xmalloc (length);
-      cmds = xmalloc (sizeof (struct cmd_list_element *) * i);
+      cp = name = (char *) xmalloc (length);
+      cmds = XNEWVEC (struct cmd_list_element *, i);
 
       /* Track back through filed 'prefix' and cache them in CMDS.  */
       for (i = 0, p = c; p != NULL; i++)