]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix some initialisations...
authorNeil Brown <neilb@suse.de>
Thu, 15 May 2008 06:48:57 +0000 (16:48 +1000)
committerNeil Brown <neilb@suse.de>
Thu, 15 May 2008 06:48:57 +0000 (16:48 +1000)
super-ddf.c

index 10647f32eacbc4ea65c8a99c5ca1b9120bf96d70..91c53dae143bfa44fcbaebaf458c8dce091ae750 100644 (file)
@@ -597,6 +597,8 @@ static int load_ddf_global(int fd, struct ddf_super *super, char *devname)
            !super->virt) {
                free(super->phys);
                free(super->virt);
+               super->phys = NULL;
+               super->virt = NULL;
                return 2;
        }
        super->conflist = NULL;
@@ -727,6 +729,7 @@ static int load_super_ddf(struct supertype *st, int fd,
                        sizeof(*super));
                return 1;
        }
+       memset(super, 0, sizeof(*super));
 
        rv = load_ddf_headers(fd, super, devname);
        if (rv) {
@@ -2251,6 +2254,7 @@ static int load_super_ddf_all(struct supertype *st, int fd,
        super = malloc(sizeof(*super));
        if (!super)
                return 1;
+       memset(super, 0, sizeof(*super));
 
        /* first, try each device, and choose the best ddf */
        for (sd = sra->devs ; sd ; sd = sd->next) {