1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-08-25 13:49:28 +03:00

Fix error path in vg_make_handle().

Enter the error condition if either of the allocations fail, and
don't use dm_pool_zalloc if dm_pool_create fails.
This commit is contained in:
Dave Wysochanski
2009-04-28 17:46:47 +00:00
parent 7833b01291
commit e08ad14696

View File

@ -2595,7 +2595,7 @@ static vg_t *_vg_make_handle(struct cmd_context *cmd,
struct dm_pool *vgmem;
if (!vg) {
if (!(vgmem = dm_pool_create("lvm2 vg_handle", VG_MEMPOOL_CHUNK)) &&
if (!(vgmem = dm_pool_create("lvm2 vg_handle", VG_MEMPOOL_CHUNK)) ||
!(vg = dm_pool_zalloc(vgmem, sizeof(*vg)))) {
log_error("Error allocating vg handle.");
if (vgmem)