Przeglądaj źródła

Merge pull request #675 from mretallack/master

fixed memory leak in get_request when fetching the remote host
bel2125 6 lat temu
rodzic
commit
7c91f79161
1 zmienionych plików z 3 dodań i 0 usunięć
  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,