Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/util/vircommand.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index 223010c6aa..f83d49ffac 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -1520,21 +1520,16 @@ virCommandAddEnvXDG(virCommandPtr cmd, const char *baseDir)
void
virCommandAddArg(virCommandPtr cmd, const char *val)
{
- char *arg;
-
if (!cmd || cmd->has_error)
return;
- arg = g_strdup(val);
-
/* Arg plus trailing NULL. */
if (VIR_RESIZE_N(cmd->args, cmd->maxargs, cmd->nargs, 1 + 1) < 0) {
- VIR_FREE(arg);
cmd->has_error = ENOMEM;
return;
}
- cmd->args[cmd->nargs++] = arg;
+ cmd->args[cmd->nargs++] = g_strdup(val);
}
--
2.26.2