Mailing List Archive

[6.0] 60b17ab54 Fix a small memory leak
commit 60b17ab541bc774e46a09247c6c0a7c7665ebb2d
Author: Martin Blix Grydeland <martin@varnish-software.com>
Date: Wed Mar 13 14:43:01 2019 +0100

Fix a small memory leak

Fix a small memory leak when failing to spawn a new thread.

diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c
index 044e140c4..15255736a 100644
--- a/bin/varnishd/cache/cache_wrk.c
+++ b/bin/varnishd/cache/cache_wrk.c
@@ -462,6 +462,7 @@ pool_breed(struct pool *qp)
pi->qp = qp;

if (pthread_create(&tp, &tp_attr, pool_thread, pi)) {
+ FREE_OBJ(pi);
VSL(SLT_Debug, 0, "Create worker thread failed %d %s",
errno, strerror(errno));
Lck_Lock(&pool_mtx);
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit