assemble_container_content(): fix memory leak

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Jes Sorensen 2011-11-01 16:09:22 +01:00 committed by NeilBrown
parent d9ca03e9c3
commit 22472ee1d2
1 changed files with 4 additions and 1 deletions

View File

@ -1527,8 +1527,11 @@ int assemble_container_content(struct supertype *st, int mdfd,
sra = sysfs_read(mdfd, 0, GET_VERSION);
if (sra == NULL || strcmp(sra->text_version, content->text_version) != 0)
if (sysfs_set_array(content, md_get_version(mdfd)) != 0)
if (sysfs_set_array(content, md_get_version(mdfd)) != 0) {
if (sra)
sysfs_free(sra);
return 1;
}
if (st->ss->external && content->recovery_blocked)
block_subarray(content);