[4.1] da8b1e2 Try to close one of the leaks reported in #1860

Lasse Karstensen lkarsten at varnish-software.com
Fri Mar 4 15:53:47 CET 2016


commit da8b1e2fd4afe935b5e9bdaf80df48ce07d7c7cb
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Feb 26 08:46:25 2016 +0000

    Try to close one of the leaks reported in #1860
    
    Conflicts:
    	bin/varnishd/cache/cache_esi_parse.c

diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c
index 383731f..5a22e77 100644
--- a/bin/varnishd/cache/cache_esi_parse.c
+++ b/bin/varnishd/cache/cache_esi_parse.c
@@ -453,13 +453,12 @@ vep_do_include(struct vep_state *vep, enum dowhat what)
 			    "ESI 1.0 <esi:include> "
 			    "has multiple src= attributes");
 			vep->state = VEP_TAGERROR;
-			VSB_delete(vep->attr_vsb);
-			VSB_delete(vep->include_src);
-			vep->attr_vsb = NULL;
-			vep->include_src = NULL;
+			VSB_destroy(&vep->attr_vsb);
+			VSB_destroy(&vep->include_src);
 			return;
 		}
 		vep->include_src = vep->attr_vsb;
+		vep->attr_vsb = NULL;
 		return;
 	}
 	assert(what == DO_TAG);
@@ -499,8 +498,8 @@ vep_do_include(struct vep_state *vep, enum dowhat what)
 			vep_warn(vep,
 			    "ESI 1.0 <esi:include> with https:// ignored");
 			vep->state = VEP_TAGERROR;
-			vep->attr_vsb = NULL;
-			vep->include_src = NULL;
+			AZ(vep->attr_vsb);
+			VSB_destroy(&vep->include_src);
 			return;
 		}
 		vep_warn(vep,
@@ -1081,6 +1080,8 @@ VEP_Finish(struct vep_state *vep)
 
 	CHECK_OBJ_NOTNULL(vep, VEP_MAGIC);
 
+	AZ(vep->include_src);
+	AZ(vep->attr_vsb);
 	if (vep->o_pending)
 		vep_mark_common(vep, vep->ver_p, vep->last_mark);
 	if (vep->o_wait > 0) {



More information about the varnish-commit mailing list