mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
libdm: ensure vars are initialized
Coverity found potential error path, where code could have used some unset variables.
This commit is contained in:
parent
b1c4017743
commit
f6c140e200
@ -822,7 +822,7 @@ static int _stats_parse_region(struct dm_stats *dms, const char *resp,
|
|||||||
struct dm_pool *mem = dms->mem;
|
struct dm_pool *mem = dms->mem;
|
||||||
struct dm_stats_counters cur;
|
struct dm_stats_counters cur;
|
||||||
FILE *stats_rows = NULL;
|
FILE *stats_rows = NULL;
|
||||||
uint64_t start, len;
|
uint64_t start = 0, len = 0;
|
||||||
char row[256];
|
char row[256];
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -2305,6 +2305,10 @@ const char *dm_histogram_to_string(const struct dm_histogram *dmh, int bin,
|
|||||||
} else if (bounds)
|
} else if (bounds)
|
||||||
len = dm_snprintf(buf, sizeof(buf), "%s%s", bounds_buf,
|
len = dm_snprintf(buf, sizeof(buf), "%s%s", bounds_buf,
|
||||||
sep);
|
sep);
|
||||||
|
else {
|
||||||
|
*buf = '\0';
|
||||||
|
len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
goto_bad;
|
goto_bad;
|
||||||
|
Loading…
Reference in New Issue
Block a user