aboutsummaryrefslogtreecommitdiff
path: root/qga/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'qga/commands.c')
-rw-r--r--qga/commands.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qga/commands.c b/qga/commands.c
index 0f80ce65a4..7644ca053a 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -398,7 +398,7 @@ GuestExec *qmp_guest_exec(const char *path,
arglist.next = has_arg ? arg : NULL;
argv = guest_exec_get_args(&arglist, true);
- envp = guest_exec_get_args(has_env ? env : NULL, false);
+ envp = has_env ? guest_exec_get_args(env, false) : NULL;
flags = G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD;
if (!has_output) {