Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- 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 c3a98bbeac..b1a26f68aa 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -1520,8 +1520,6 @@ virCommandAddEnvXDG(virCommandPtr cmd, const char *baseDir) void virCommandAddArg(virCommandPtr cmd, const char *val) { - char *arg; - if (!cmd || cmd->has_error) return; @@ -1530,16 +1528,13 @@ virCommandAddArg(virCommandPtr cmd, const char *val) 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