1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

coverity: check malloc results

This commit is contained in:
Zdenek Kabelac 2017-06-27 10:18:00 +02:00
parent e907535ab9
commit 8e790702f1

View File

@ -743,7 +743,11 @@ static void add_oo_definition_line(const char *name, const char *line)
char *start;
oo = &oo_lines[oo_line_count++];
oo->name = dm_strdup(name);
if (!(oo->name = dm_strdup(name))) {
log_error("Failer to duplicate name %s.", name);
return; /* FIXME: return code */
}
if ((colon = strchr(oo->name, ':')))
*colon = '\0';
@ -753,7 +757,10 @@ static void add_oo_definition_line(const char *name, const char *line)
}
start = strchr(line, ':') + 2;
oo->line = dm_strdup(start);
if (!(oo->line = dm_strdup(start))) {
log_error("Failer to duplicate line %s.", start);
return;
}
}
/* Support OO_FOO: continuing on multiple lines. */