Browse Source

[core] do not free() reused buffer

personal/stbuehler/fix-fdevent
Glenn Strauss 3 years ago
parent
commit
c2bd063ac4
  1. 6
      src/http-header-glue.c

6
src/http-header-glue.c

@ -39,18 +39,14 @@ int http_response_redirect_to_directory(server *srv, connection *con) {
if (-1 == getsockname(con->fd, (struct sockaddr *)&our_addr, &our_addr_len)
|| our_addr_len > (socklen_t)sizeof(our_addr)) {
con->http_status = 500;
log_error_write(srv, __FILE__, __LINE__, "ss",
"can't get sockname", strerror(errno));
buffer_free(o);
return 0;
return -1;
}
/* Lookup name: secondly try to get hostname for bind address */
if (0 != sock_addr_nameinfo_append_buffer(srv, o, &our_addr)) {
con->http_status = 500;
buffer_free(o);
return -1;
} else {
unsigned short default_port = 80;

Loading…
Cancel
Save