]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix for memory leak defect.
authorArtur Wojcik <artur.wojcik@intel.com>
Thu, 10 Dec 2009 19:03:40 +0000 (12:03 -0700)
committerDan Williams <dan.j.williams@intel.com>
Thu, 10 Dec 2009 19:03:40 +0000 (12:03 -0700)
Possible memory leak. Dynamic memory stored in 'dev' and 'dev' allocated
through function 'malloc' can be lost on exit path.

Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
super-intel.c

index 5c967b2a15eb21e22fe4d74ab523af5bd28943e2..d87b2b03f71e1dd22bde96d5159e0bf588c82510 100644 (file)
@@ -2810,6 +2810,8 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
        map->ddf = 1;
 
        if (info->level == 1 && info->raid_disks > 2) {
+               free(dev);
+               free(dv);
                fprintf(stderr, Name": imsm does not support more than 2 disks"
                                "in a raid1 volume\n");
                return 0;