mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-09 12:58:41 +03:00
cov: dmstats check for failing malloc
Add missing check for allocation success. Backported from: 9b7121226258f7dfe759cc1f8625cbfb80fec161
This commit is contained in:
parent
ece117ee10
commit
c115d92287
@ -5216,7 +5216,10 @@ static int _do_stats_create_regions(struct dm_stats *dms,
|
||||
if (!segments || (info.target_count == 1))
|
||||
region_ids = ®ion_id;
|
||||
else
|
||||
region_ids = dm_malloc(info.target_count * sizeof(*region_ids));
|
||||
if (!(region_ids = dm_malloc(info.target_count * sizeof(*region_ids)))) {
|
||||
log_error("Failed to allocated region IDs.");
|
||||
goto out;
|
||||
}
|
||||
|
||||
do {
|
||||
uint64_t segment_start, segment_len;
|
||||
|
Loading…
x
Reference in New Issue
Block a user