diff options
-rw-r--r-- | lib/label/hints.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/label/hints.c b/lib/label/hints.c index 09f12deb6..df1327a10 100644 --- a/lib/label/hints.c +++ b/lib/label/hints.c @@ -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: /* |