diff --git a/tests/commandhelper.c b/tests/commandhelper.c index bf6a5baa40..b3c65ab3cc 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -156,6 +156,9 @@ static int printEnvironment(FILE *log) for (length = 0; environ[length]; length++) { } + if (length == 0) + return 0; + if (!(newenv = malloc(sizeof(*newenv) * length))) return -1;