1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00

cov: ensure pointer has defined value

Add initialization of 'fin' pointer.
This commit is contained in:
Zdenek Kabelac 2024-05-13 17:29:15 +02:00
parent c6b5eb5b50
commit a86fb27607
2 changed files with 4 additions and 4 deletions

View File

@ -4107,7 +4107,7 @@ static int _alloc_rh_selection(struct dm_report *rh)
static int _report_set_selection(struct dm_report *rh, const char *selection, int add_new_fields) static int _report_set_selection(struct dm_report *rh, const char *selection, int add_new_fields)
{ {
struct selection_node *root = NULL; struct selection_node *root = NULL;
const char *fin, *next; const char *fin = NULL, *next;
if (rh->selection) { if (rh->selection) {
if (rh->selection->selection_root) if (rh->selection->selection_root)
@ -4127,7 +4127,7 @@ static int _report_set_selection(struct dm_report *rh, const char *selection, in
if (!(root = _alloc_selection_node(rh->selection->mem, SEL_OR))) if (!(root = _alloc_selection_node(rh->selection->mem, SEL_OR)))
return 0; return 0;
if (!_parse_or_ex(rh, selection, &fin, root)) if (!_parse_or_ex(rh, selection, &fin, root) || !fin)
goto_bad; goto_bad;
next = _skip_space(fin); next = _skip_space(fin);

View File

@ -4105,7 +4105,7 @@ static int _alloc_rh_selection(struct dm_report *rh)
static int _report_set_selection(struct dm_report *rh, const char *selection, int add_new_fields) static int _report_set_selection(struct dm_report *rh, const char *selection, int add_new_fields)
{ {
struct selection_node *root = NULL; struct selection_node *root = NULL;
const char *fin, *next; const char *fin = NULL, *next;
if (rh->selection) { if (rh->selection) {
if (rh->selection->selection_root) if (rh->selection->selection_root)
@ -4125,7 +4125,7 @@ static int _report_set_selection(struct dm_report *rh, const char *selection, in
if (!(root = _alloc_selection_node(rh->selection->mem, SEL_OR))) if (!(root = _alloc_selection_node(rh->selection->mem, SEL_OR)))
return 0; return 0;
if (!_parse_or_ex(rh, selection, &fin, root)) if (!_parse_or_ex(rh, selection, &fin, root) || !fin)
goto_bad; goto_bad;
next = _skip_space(fin); next = _skip_space(fin);