mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
stats: fix error path when region is NULL
We should not call _stats_cleanup_region_ids() when regions are NULL. Also add backtracing for goto.
This commit is contained in:
parent
0161ebe484
commit
3750b0cff5
@ -4869,24 +4869,24 @@ uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd,
|
||||
group_id, &count, ®roup);
|
||||
|
||||
if (!regions)
|
||||
goto bad;
|
||||
goto_out;
|
||||
|
||||
if (!dm_stats_list(dms, NULL))
|
||||
goto bad;
|
||||
goto_bad;
|
||||
|
||||
/* regroup if there are regions to group */
|
||||
if (regroup && (*regions != DM_STATS_REGION_NOT_PRESENT))
|
||||
if (!_stats_group_file_regions(dms, regions, count, alias))
|
||||
goto bad;
|
||||
goto_bad;
|
||||
|
||||
dm_free(bounds);
|
||||
dm_free((char *) alias);
|
||||
return regions;
|
||||
bad:
|
||||
_stats_cleanup_region_ids(dms, regions, count);
|
||||
dm_free(bounds);
|
||||
dm_free(regions);
|
||||
out:
|
||||
dm_free(regions);
|
||||
dm_free(bounds);
|
||||
dm_free((char *) alias);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user