X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=blobdiff_plain;f=super0.c;h=55e71e8c582fe9d8b91ced8c9ed7cff5a20edc61;hp=c8cbb9d96230a8ae386d7424b0b71b3040d1d9ff;hb=503975b9d5f0696b5d2ee20ea903b859e3f60662;hpb=c8e1a230b73c44aff5beeeb74d32e36219bed12d diff --git a/super0.c b/super0.c index c8cbb9d9..55e71e8c 100644 --- a/super0.c +++ b/super0.c @@ -418,7 +418,7 @@ static struct mdinfo *container_content0(struct supertype *st, char *subarray) if (subarray) return NULL; - info = malloc(sizeof(*info)); + info = xmalloc(sizeof(*info)); getinfo_super0(st, info, NULL); return info; } @@ -710,7 +710,7 @@ static int add_to_super0(struct supertype *st, mdu_disk_info_t *dinfo, dip = (struct devinfo **)&st->info; while (*dip) dip = &(*dip)->next; - di = malloc(sizeof(struct devinfo)); + di = xmalloc(sizeof(struct devinfo)); di->fd = fd; di->devname = devname; di->disk = *dinfo; @@ -942,9 +942,7 @@ static int load_super0(struct supertype *st, int fd, char *devname) static struct supertype *match_metadata_desc0(char *arg) { - struct supertype *st = calloc(1, sizeof(*st)); - if (!st) - return st; + struct supertype *st = xcalloc(1, sizeof(*st)); st->container_dev = NoMdDev; st->ss = &super0;