error log: keep more calloc and its error messages match

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
This commit is contained in:
Chen Hanxiao
2015-06-18 16:35:56 +08:00
committed by Richard W.M. Jones
parent 6118e2239c
commit 3ae5f72743
11 changed files with 21 additions and 21 deletions

View File

@@ -191,7 +191,7 @@ main (int argc, char *argv[])
access (argv[optind], F_OK) == 0) { /* simulate -a option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_a;
@@ -205,7 +205,7 @@ main (int argc, char *argv[])
} else { /* simulate -d option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_d;

View File

@@ -293,7 +293,7 @@ main (int argc, char *argv[])
access (argv[optind], F_OK) == 0) { /* simulate -a option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_a;
@@ -307,7 +307,7 @@ main (int argc, char *argv[])
} else { /* simulate -d option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_d;

View File

@@ -394,7 +394,7 @@ parse_md_stat_line (char *line)
ret->guestfs_int_mdstat_list_val =
calloc (spaces+1, sizeof (struct guestfs_int_mdstat));
if (ret->guestfs_int_mdstat_list_val == NULL) {
reply_with_perror ("malloc");
reply_with_perror ("calloc");
free (ret);
return NULL;
}

View File

@@ -138,7 +138,7 @@ do_internal_lstatnslist (const char *path, char *const *names)
ret->guestfs_int_statns_list_val =
calloc (nr_names, sizeof (guestfs_int_statns));
if (ret->guestfs_int_statns_list_val == NULL) {
reply_with_perror ("malloc");
reply_with_perror ("calloc");
free (ret);
return NULL;
}

View File

@@ -120,7 +120,7 @@ getxattrs (const char *path,
r = calloc (1, sizeof (*r));
if (r == NULL) {
reply_with_perror ("malloc");
reply_with_perror ("calloc");
goto error;
}

View File

@@ -217,7 +217,7 @@ main (int argc, char *argv[])
access (argv[optind], F_OK) == 0) { /* simulate -a option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_a;
@@ -231,7 +231,7 @@ main (int argc, char *argv[])
} else { /* simulate -d option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_d;

View File

@@ -226,7 +226,7 @@ main (int argc, char *argv[])
access (argv[optind], F_OK) == 0) { /* simulate -a option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_a;
@@ -240,7 +240,7 @@ main (int argc, char *argv[])
} else { /* simulate -d option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_d;

View File

@@ -361,7 +361,7 @@ main (int argc, char *argv[])
}
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_N;
@@ -449,7 +449,7 @@ main (int argc, char *argv[])
access (argv[optind], F_OK) == 0) { /* simulate -a option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_a;
@@ -463,7 +463,7 @@ main (int argc, char *argv[])
} else { /* simulate -d option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_d;

View File

@@ -38,7 +38,7 @@ option_a (const char *arg, const char *format, struct drv **drvsp)
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
@@ -84,7 +84,7 @@ option_d (const char *arg, struct drv **drvsp)
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}

View File

@@ -196,7 +196,7 @@ main (int argc, char *argv[])
access (argv[optind], F_OK) == 0) { /* simulate -a option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_a;
@@ -210,7 +210,7 @@ main (int argc, char *argv[])
} else { /* simulate -d option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_d;

View File

@@ -253,7 +253,7 @@ main (int argc, char *argv[])
access (argv[optind], F_OK) == 0) { /* simulate -a option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_a;
@@ -267,7 +267,7 @@ main (int argc, char *argv[])
} else { /* simulate -d option */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_d;
@@ -530,7 +530,7 @@ add_scratch_disk (struct drv **drvs)
/* Add the scratch disk to the drives list. */
drv = calloc (1, sizeof (struct drv));
if (!drv) {
perror ("malloc");
perror ("calloc");
exit (EXIT_FAILURE);
}
drv->type = drv_scratch;