mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cov: dmstats check for failing malloc
Add missing check for allocation success.
This commit is contained in:
parent
30b1b57506
commit
9b71212262
@ -5224,7 +5224,10 @@ static int _do_stats_create_regions(struct dm_stats *dms,
|
|||||||
if (!segments || (info.target_count == 1))
|
if (!segments || (info.target_count == 1))
|
||||||
region_ids = ®ion_id;
|
region_ids = ®ion_id;
|
||||||
else
|
else
|
||||||
region_ids = malloc(info.target_count * sizeof(*region_ids));
|
if (!(region_ids = malloc(info.target_count * sizeof(*region_ids)))) {
|
||||||
|
log_error("Failed to allocated region IDs.");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
uint64_t segment_start, segment_len;
|
uint64_t segment_start, segment_len;
|
||||||
|
Loading…
Reference in New Issue
Block a user