diff options
author | NeilBrown <neilb@suse.de> | 2009-10-22 11:00:56 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-10-22 11:00:56 +1100 |
commit | 0eb26465c0a14d707ca00f4f7bcdb67bde36f706 (patch) | |
tree | 60ccd8c30d747fce5a40926cddf6af0a1e9531d4 /Manage.c | |
parent | 1799c9e8f8465fdbd583dfe6381400e1d01d4954 (diff) |
Free some malloced memory that wasn't being freed.
As mdadm is normally a short-lived program it isn't always necessary
to free memory that was allocated, as the 'exit()' call will
automatically free everything. But it is more obviously correct if
the 'free' is there.
So this patch add a few calls to 'free'
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Manage.c')
-rw-r--r-- | Manage.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -140,7 +140,7 @@ static void remove_devices(int devnum, char *path) strcpy(path2, path); pe = path2 + strlen(path2); } else - path = NULL; + path2 = path = NULL; for (part = 0; part < 16; part++) { if (part) { @@ -161,6 +161,7 @@ static void remove_devices(int devnum, char *path) unlink(path2); } } + free(path2); } @@ -667,6 +668,7 @@ int Manage_subdevs(char *devname, int fd, disc.state |= (1<<MD_DISK_SYNC); break; } + free(used); } if (dv->writemostly == 1) disc.state |= (1 << MD_DISK_WRITEMOSTLY); |