From: Jes Sorensen Date: Tue, 20 Mar 2012 21:00:50 +0000 (+1100) Subject: match_metadata_desc1(): Use calloc instead of malloc+memset X-Git-Tag: mdadm-3.2.4~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2de0b8a2b4d4c0bdc7fbe4caf591a7c160d86da5;p=thirdparty%2Fmdadm.git match_metadata_desc1(): Use calloc instead of malloc+memset Signed-off-by: Jes Sorensen Signed-off-by: NeilBrown --- diff --git a/super1.c b/super1.c index 4da59917..61655ada 100644 --- a/super1.c +++ b/super1.c @@ -1408,10 +1408,10 @@ static int load_super1(struct supertype *st, int fd, char *devname) static struct supertype *match_metadata_desc1(char *arg) { - struct supertype *st = malloc(sizeof(*st)); - if (!st) return st; + struct supertype *st = calloc(1, sizeof(*st)); + if (!st) + return st; - memset(st, 0, sizeof(*st)); st->container_dev = NoMdDev; st->ss = &super1; st->max_devs = MAX_DEVS;