diff --git a/tests/testutils.c b/tests/testutils.c index d6cd1936d0fb0a903de184784ac33a72e82337bd..fc4c339bb7fe9e7c9024a63dbebce88e8c01d62b 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -822,7 +822,8 @@ virTestSetEnvPath(void) goto cleanup; } - if (setenv("PATH", new_path, 1) < 0) + if (new_path && + setenv("PATH", new_path, 1) < 0) goto cleanup; ret = 0;