mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +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:
parent
93644be44b
commit
d28a50ec76
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user