Fixes: #1146
---
 bin/varnishd/storage/storage_persistent_silo.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/varnishd/storage/storage_persistent_silo.c 
b/bin/varnishd/storage/storage_persistent_silo.c
index 6ed80d2..d433cde 100644
--- a/bin/varnishd/storage/storage_persistent_silo.c
+++ b/bin/varnishd/storage/storage_persistent_silo.c
@@ -253,9 +253,11 @@ smp_close_seg(struct smp_sc *sc, struct smp_seg *sg)
        sc->cur_seg = NULL;
 
        if (sg->nalloc == 0) {
-               /* XXX: if segment is empty, delete instead */
+               /* If segment is empty, delete instead */
+               sc->free_offset = sg->p.offset;
                VTAILQ_REMOVE(&sc->segments, sg, list);
-               free(sg);
+               LRU_Free(sg->lru);
+               FREE_OBJ(sg);
                return;
        }
 
-- 
1.7.9.5


_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to