mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
hints: validate allocation result
This commit is contained in:
parent
219fe72359
commit
1349a52626
@ -1175,7 +1175,8 @@ static void _get_single_vgname_cmd_arg(struct cmd_context *cmd,
|
||||
|
||||
if (!(st = strchr(arg, '/'))) {
|
||||
/* simple vgname */
|
||||
name = strdup(arg);
|
||||
if (!(name = strdup(arg)))
|
||||
return;
|
||||
goto check;
|
||||
}
|
||||
|
||||
@ -1183,7 +1184,8 @@ static void _get_single_vgname_cmd_arg(struct cmd_context *cmd,
|
||||
for (p = arg; p < st; p++)
|
||||
namebuf[i++] = *p;
|
||||
|
||||
name = strdup(namebuf);
|
||||
if (!(name = strdup(namebuf)))
|
||||
return;
|
||||
|
||||
check:
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user