*/
int main(int argc, char *argv[])
{
+ int free_query_string = 0;
int exit_status = SUCCESS;
int cgi = 0, c, i, len;
zend_file_handle file_handle;
len += strlen(argv[i]) + 1;
}
- s = malloc(len + 1); /* leak - but only for command line version, so ok */
+ s = malloc(len + 1);
*s = '\0'; /* we are pretending it came from the environment */
for (i = php_optind, len = 0; i < argc; i++) {
strcat(s, argv[i]);
}
}
SG(request_info).query_string = s;
+ free_query_string = 1;
}
} /* end !cgi && !fastcgi */
free(SG(request_info).path_translated);
SG(request_info).path_translated = NULL;
}
+ if (free_query_string && SG(request_info).query_string) {
+ free(SG(request_info).query_string);
+ SG(request_info).query_string = NULL;
+ }
+
}
#if PHP_FASTCGI