summaryrefslogtreecommitdiff
path: root/libdm
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2017-02-11 21:17:41 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2017-02-12 17:28:13 +0100
commita7d2ee4bc2dd032cd15db028b3c118ce7138c854 (patch)
tree7962a3b70872c8fa5eaaf74ab32377834ada7ec9 /libdm
parent0844b20f985177f60db48dc84bcde7170d17a77e (diff)
downloadlvm2-a7d2ee4bc2dd032cd15db028b3c118ce7138c854.tar.gz
coverity: fix mem leak on error path in dm stats
Free allocated resouces on error path.
Diffstat (limited to 'libdm')
-rw-r--r--libdm/libdm-stats.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index f68874cae..032be0391 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -4842,7 +4842,7 @@ uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd,
if (!bounds) {
log_error("Could not allocate memory for group "
"histogram bounds.");
- return NULL;
+ goto out;
}
_stats_copy_histogram_bounds(bounds,
dms->regions[group_id].bounds);
@@ -4869,6 +4869,8 @@ uint64_t *dm_stats_update_regions_from_fd(struct dm_stats *dms, int fd,
bad:
_stats_cleanup_region_ids(dms, regions, count);
dm_free(bounds);
+ dm_free(regions);
+out:
dm_free((char *) alias);
return NULL;
}