Use XCALLOC / XZALLOC macros where reasonable
[pspp] / src / language / stats / median.c
index 9c35c15a456aa54820a3faafaa847e5bbbcd3136..2e09ab02cef0d21c621d8dbf6b6ca3eca624a47d 100644 (file)
@@ -134,7 +134,7 @@ median_execute (const struct dataset *ds,
 
       if (n_sample_test == false)
        {
-         struct val_node *vn = xzalloc (sizeof *vn);
+         struct val_node *vn = XZALLOC (struct val_node);
          value_clone (&vn->val,  &nst->val1, var_get_width (nst->indep_var));
          hmap_insert (&map, &vn->node, value_hash (&nst->val1,
                                            var_get_width (nst->indep_var), 0));
@@ -253,7 +253,7 @@ median_execute (const struct dataset *ds,
          }
 
        results[v].n = count;
-       results[v].sorted_array = xcalloc (hmap_count (&map), sizeof (void*));
+       results[v].sorted_array = XCALLOC (hmap_count (&map), void*);
        results[v].var = var;
 
        HMAP_FOR_EACH (vn, struct val_node, node, &map)