diff --git a/src/fastcgi/lfcgi.c b/src/fastcgi/lfcgi.c index 44141b1..36c40e4 100644 --- a/src/fastcgi/lfcgi.c +++ b/src/fastcgi/lfcgi.c @@ -561,7 +561,7 @@ static char **lf_copy_environ() return NULL; /* Allocate the space to hold the elements. */ - env = malloc(i*sizeof(*env)); + env = malloc((i+1)*sizeof(*env)); /* Copy the elements into the new array. */ i = 0;