Explorar el Código

Merge pull request #675 from mretallack/master

fixed memory leak in get_request when fetching the remote host
bel2125 hace 6 años
padre
commit
7c91f79161
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/civetweb.c

+ 3 - 0
src/civetweb.c

@@ -16947,6 +16947,9 @@ get_request(struct mg_connection *conn, char *ebuf, size_t ebuf_len, int *err)
 	/* Message is a valid request */
 
 	/* Is there a "host" ? */
+	if (conn->host!=NULL) {
+		mg_free((void *)conn->host);
+	}
 	conn->host = alloc_get_host(conn);
 	if (!conn->host) {
 		mg_snprintf(conn,