From 288fa1967da567b1d8095c41a8238f965e99478d Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 13 Feb 2009 13:42:44 +0000 Subject: [PATCH] Make sure to clean the VBE properly before releasing it. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3768 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_backend_cfg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_backend_cfg.c b/varnish-cache/bin/varnishd/cache_backend_cfg.c index 50a557b0..311d2137 100644 --- a/varnish-cache/bin/varnishd/cache_backend_cfg.c +++ b/varnish-cache/bin/varnishd/cache_backend_cfg.c @@ -112,8 +112,11 @@ VBE_DropRefLocked(struct backend *b) ASSERT_CLI(); VTAILQ_FOREACH_SAFE(vbe, &b->connlist, list, vbe2) { VTAILQ_REMOVE(&b->connlist, vbe, list); - if (vbe->fd >= 0) + if (vbe->fd >= 0) { AZ(close(vbe->fd)); + vbe->fd = -1; + } + vbe->backend = NULL; VBE_ReleaseConn(vbe); } if (b->probe != NULL) -- 2.39.5