[master] dbd95ce2e Fix a small memory leak

Martin Blix Grydeland martin at varnish-software.com
Mon Nov 18 14:33:07 UTC 2019


commit dbd95ce2efa334c682b47c3cd47adfe735484f09
Author: Martin Blix Grydeland <martin at 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 eeabe4061..dd032850f 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, vstrerror(errno));
 		Lck_Lock(&pool_mtx);


More information about the varnish-commit mailing list