mirror of
git://sourceware.org/git/lvm2.git
synced 2025-07-12 08:58:58 +03:00
libdm: make dm_stats_destroy(NULL) a no-op
Test for NULL in dm_stats_destroy() and return immediately if the struct dm_stats pointer is NULL (similar to free(NULL)). This simplifies cleanup code which otherwise needs to: out: if (dms) dm_stats_destroy(dms); return;
This commit is contained in:
@ -2387,6 +2387,9 @@ bad:
|
||||
*/
|
||||
void dm_stats_destroy(struct dm_stats *dms)
|
||||
{
|
||||
if (!dms)
|
||||
return;
|
||||
|
||||
_stats_regions_destroy(dms);
|
||||
_stats_groups_destroy(dms);
|
||||
_stats_clear_binding(dms);
|
||||
|
Reference in New Issue
Block a user