1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add check for allocation failure

This commit is contained in:
Zdenek Kabelac 2012-02-13 11:16:42 +00:00
parent daaea2ef94
commit 3e74542b5d
2 changed files with 11 additions and 9 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.92 -
====================================
Add check for allocation failure in _build_matcher().
Add check for rimage name allocation failure in _raid_add_images().
Add check for mda_copy failure in _text_pv_setup().
Add check for _mirrored_init_target failure.

View File

@ -110,16 +110,17 @@ static int _build_matcher(struct rfilter *rf, const struct dm_config_value *val)
count++;
}
/*
* allocate space for them
*/
if (!(regex = dm_pool_alloc(scratch, sizeof(*regex) * count)))
goto_out;
/* Allocate space for them */
if (!(regex = dm_pool_alloc(scratch, sizeof(*regex) * count))) {
log_error("Failed to allocate regex.");
goto out;
}
/*
* create the accept/reject bitset
*/
rf->accept = dm_bitset_create(rf->mem, count);
/* Create the accept/reject bitset */
if (!(rf->accept = dm_bitset_create(rf->mem, count))) {
log_error("Failed to create bitset.");
goto out;
}
/*
* fill the array back to front because we