From: Marian Csontos Date: Tue, 28 Nov 2023 20:41:35 +0000 (+0100) Subject: dmstats: Fix memory leak on error path X-Git-Tag: v2_03_24~430 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=d1f0b89e65fd8817930bbf89051fe03efb0a1db5;p=lvm2.git dmstats: Fix memory leak on error path --- diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 3b1fbe8a0..47f028155 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -2047,7 +2047,7 @@ static int _stats_create_region(struct dm_stats *dms, uint64_t *region_id, (strlen(hist_arg)) ? HISTOGRAM_ARG : "", hist_arg)) < 0) { log_error(err_fmt, PRECISE_ARG " option."); - return 0; + goto out; } } else opt_args = dm_strdup("");