1
0
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:
Zdenek Kabelac 2019-11-14 18:00:00 +01:00
parent 219fe72359
commit 1349a52626

View File

@ -1175,7 +1175,8 @@ static void _get_single_vgname_cmd_arg(struct cmd_context *cmd,
if (!(st = strchr(arg, '/'))) { if (!(st = strchr(arg, '/'))) {
/* simple vgname */ /* simple vgname */
name = strdup(arg); if (!(name = strdup(arg)))
return;
goto check; goto check;
} }
@ -1183,7 +1184,8 @@ static void _get_single_vgname_cmd_arg(struct cmd_context *cmd,
for (p = arg; p < st; p++) for (p = arg; p < st; p++)
namebuf[i++] = *p; namebuf[i++] = *p;
name = strdup(namebuf); if (!(name = strdup(namebuf)))
return;
check: check:
/* /*