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:
@ -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)
|
||||
|
Reference in New Issue
Block a user