You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jd...@apache.org on 2021/03/22 21:32:19 UTC
[qpid-dispatch] branch master updated: DISPATCH-1962 Fix leak from
libwebsockets.so in unit_tests (#1080)
This is an automated email from the ASF dual-hosted git repository.
jdanek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push:
new 9262f7a DISPATCH-1962 Fix leak from libwebsockets.so in unit_tests (#1080)
9262f7a is described below
commit 9262f7a801c493dacf220b2d52e9da4a2d59e53c
Author: Jiri Daněk <jd...@redhat.com>
AuthorDate: Mon Mar 22 22:32:09 2021 +0100
DISPATCH-1962 Fix leak from libwebsockets.so in unit_tests (#1080)
---
src/http-libwebsockets.c | 4 ++--
src/server.c | 5 +++--
tests/lsan.supp | 7 -------
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/http-libwebsockets.c b/src/http-libwebsockets.c
index 66cf187..8487130 100644
--- a/src/http-libwebsockets.c
+++ b/src/http-libwebsockets.c
@@ -746,9 +746,9 @@ static int callback_healthz(struct lws *wsi, enum lws_callback_reasons reason,
ZERO(stats->context);
stats->context->wsi = wsi;
stats->context->server = hs;
- //make dummy request for stats (pass in null ptr); this still excercises the
+ //make dummy request for stats (pass in null ptr); this still exercises the
//path through core thread and back through callback on io thread which is
- //a resonable initial liveness check
+ //a reasonable initial liveness check
qdr_request_global_stats(hs->core, 0, handle_stats_results, (void*) stats->context);
return 0;
}
diff --git a/src/server.c b/src/server.c
index 58d06a6..907a368 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1372,6 +1372,9 @@ qd_server_t *qd_server(qd_dispatch_t *qd, int thread_count, const char *containe
void qd_server_free(qd_server_t *qd_server)
{
if (!qd_server) return;
+
+ qd_http_server_free(qd_server->http);
+
qd_connection_t *ctx = DEQ_HEAD(qd_server->conn_list);
while (ctx) {
qd_log(qd_server->log_source, QD_LOG_INFO,
@@ -1487,8 +1490,6 @@ void qd_server_run(qd_dispatch_t *qd)
sys_thread_free(threads[i]);
}
free(threads);
- qd_http_server_stop(qd_server->http); /* Stop HTTP threads immediately */
- qd_http_server_free(qd_server->http);
qd_log(qd_server->log_source, QD_LOG_NOTICE, "Shut Down");
}
diff --git a/tests/lsan.supp b/tests/lsan.supp
index 8094671..adbec42 100644
--- a/tests/lsan.supp
+++ b/tests/lsan.supp
@@ -2,9 +2,6 @@
# found by AddressSanitizer (ASAN)
#
-# to be triaged; unit_tests
-leak:http-libwebsockets.c
-
# to be triaged; pretty much all tests
leak:^IoAdapter_init$
@@ -100,8 +97,4 @@ leak:^pn_object_new$
leak:^pn_list$
leak:^pni_record_create$
-### libwebsockets
-
-leak:/libwebsockets.so
-
### CMake will append .so 3rd party suppressions here, unless disabled:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org