Replace some xmalloc-family functions with XNEW-family ones
[deliverable/binutils-gdb.git] / gdb / nat / linux-osdata.c
index 502356fd90cb948c35ccd6eb81f4b87f74c00135..03e4a86cfb14d07bd2b9960c599f40a17f7353d8 100644 (file)
@@ -337,7 +337,7 @@ linux_xfer_osdata_processes (gdb_byte *readbuf,
                strcpy (user, "?");
 
              /* Find CPU cores used by the process.  */
-             cores = (int *) xcalloc (num_cores, sizeof (int));
+             cores = XCNEWVEC (int, num_cores);
              task_count = get_cores_used_by_process (pid, cores, num_cores);
              cores_str = (char *) xcalloc (task_count, sizeof ("4294967295") + 1);
 
@@ -460,7 +460,7 @@ linux_xfer_osdata_processgroups (gdb_byte *readbuf,
        {
          struct dirent *dp;
          const size_t list_block_size = 512;
-         PID_T *process_list = (PID_T *) xmalloc (list_block_size * 2 * sizeof (PID_T));
+         PID_T *process_list = XNEWVEC (PID_T, list_block_size * 2);
          size_t process_count = 0;
          size_t i;
 
This page took 0.027592 seconds and 4 git commands to generate.