1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

libdm: fix resource leak in dm_stats_set_alias()

When we fail to update aux_data the newly allocated group->alias must
be freed before reinstating old_alias.
This commit is contained in:
Bryn M. Reeves 2016-07-08 10:51:19 +01:00
parent 5e06b33c51
commit 059a383cf8

View File

@ -3106,6 +3106,7 @@ int dm_stats_set_alias(struct dm_stats *dms, uint64_t group_id, const char *alia
return 1; return 1;
bad: bad:
dm_free((char *) group->alias);
group->alias = old_alias; group->alias = old_alias;
return 0; return 0;
} }