n = send(TG(hc)->conn_fd, str, str_length, 0);
- if (n == EPIPE) {
+ if (n == -1 && errno == EPIPE) {
php_handle_aborted_connection();
}
size_t filename_len;
size_t cwd_len;
- SG(request_info).query_string = TG(hc)->query;
+
+ SG(request_info).query_string = TG(hc)->query?strdup(TG(hc)->query):NULL;
filename_len = strlen(TG(hc)->expnfilename);
cwd_len = strlen(TG(hc)->hs->cwd);
static void thttpd_request_dtor(TLS_D SLS_DC)
{
+ if (SG(request_info).query_string)
+ free(SG(request_info).query_string);
free(SG(request_info).request_uri);
free(SG(request_info).path_translated);
}