mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-21 23:53:24 +01:00
Resolve KASM-2798 "Bugfix/ memory leak"
This commit is contained in:
parent
61f08d4986
commit
4e134b578c
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -1,4 +1,4 @@
|
||||
[submodule "kasmweb"]
|
||||
path = kasmweb
|
||||
url = https://github.com/kasmtech/noVNC.git
|
||||
branch = feature/KASM-2634_UI_updates
|
||||
branch = master
|
||||
|
@ -931,6 +931,8 @@ void network::createWebsocketListeners(std::list<SocketListener*> *listeners,
|
||||
freeaddrinfo(ai);
|
||||
throw;
|
||||
}
|
||||
|
||||
freeaddrinfo(ai);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -249,6 +249,7 @@ void free_ws_ctx(ws_ctx_t *ctx) {
|
||||
free(ctx->cout_buf);
|
||||
free(ctx->tin_buf);
|
||||
free(ctx->tout_buf);
|
||||
free(ctx->headers);
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
@ -947,7 +948,8 @@ static void servefile(ws_ctx_t *ws_ctx, const char *in, const char * const user,
|
||||
"Content-length: %lu\r\n"
|
||||
"\r\n",
|
||||
name2mime(path), filesize);
|
||||
ws_send(ws_ctx, buf, strlen(buf));
|
||||
const unsigned hdrlen = strlen(buf);
|
||||
ws_send(ws_ctx, buf, hdrlen);
|
||||
|
||||
//fprintf(stderr, "http servefile output '%s'\n", buf);
|
||||
|
||||
@ -957,7 +959,7 @@ static void servefile(ws_ctx_t *ws_ctx, const char *in, const char * const user,
|
||||
}
|
||||
fclose(f);
|
||||
|
||||
weblog(200, wsthread_handler_id, 0, origip, ip, user, 1, path, strlen(buf) + filesize);
|
||||
weblog(200, wsthread_handler_id, 0, origip, ip, user, 1, path, hdrlen + filesize);
|
||||
|
||||
return;
|
||||
nope:
|
||||
@ -1947,7 +1949,14 @@ void *start_server(void *unused) {
|
||||
pthread_t tid;
|
||||
pass->id = settings.handler_id;
|
||||
pass->csock = csock;
|
||||
pthread_create(&tid, NULL, subthread, pass);
|
||||
|
||||
pthread_attr_t attr;
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||
|
||||
pthread_create(&tid, &attr, subthread, pass);
|
||||
|
||||
pthread_attr_destroy(&attr);
|
||||
|
||||
settings.handler_id += 1;
|
||||
}
|
||||
|
2
kasmweb
2
kasmweb
@ -1 +1 @@
|
||||
Subproject commit 9a6f97115cf8fbbe7242cf6c4117da54cc6d7a24
|
||||
Subproject commit 7e5a302a7a47472a679391ef24b18a78c936a9f6
|
Loading…
Reference in New Issue
Block a user