diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2012-01-25 21:54:00 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2012-01-25 21:54:00 +0000 |
commit | a980f56d2aea6d1aa2fae740187b62f59e33a761 (patch) | |
tree | e98d8ad5dbb8a0799a907477b0d7a46b467f949d /lib/raid/raid.c | |
parent | 1ef10bd81afc97ac0763383c7083d25d8c2be18c (diff) | |
download | lvm2-a980f56d2aea6d1aa2fae740187b62f59e33a761.tar.gz lvm2-a980f56d2aea6d1aa2fae740187b62f59e33a761.tar.xz lvm2-a980f56d2aea6d1aa2fae740187b62f59e33a761.zip |
Free allocated segment type in error path
Diffstat (limited to 'lib/raid/raid.c')
-rw-r--r-- | lib/raid/raid.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/raid/raid.c b/lib/raid/raid.c index 445146b0..3656dada 100644 --- a/lib/raid/raid.c +++ b/lib/raid/raid.c @@ -452,8 +452,10 @@ int init_multiple_segtypes(struct cmd_context *cmd, struct segtype_library *segl do { if ((segtype = raid_segtype_fn[i](cmd)) && - !lvm_register_segtype(seglib, segtype)) - return 0; + !lvm_register_segtype(seglib, segtype)) { + dm_free(segtype); + return_0; + } } while (raid_segtype_fn[++i]); return 1; |