[4.1] caf8853 Fix (insignificant) memory leak with mal-formed ESI directives.

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Tue Apr 26 11:44:05 CEST 2016


commit caf885323892dc42605f87683c5275511c018f15
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Apr 19 16:34:23 2016 +0000

    Fix (insignificant) memory leak with mal-formed ESI directives.
    
    Fixes #1912

diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c
index cca9208..8e8dd8f 100644
--- a/bin/varnishd/cache/cache_esi_parse.c
+++ b/bin/varnishd/cache/cache_esi_parse.c
@@ -851,6 +851,8 @@ VEP_Parse(struct vep_state *vep, const char *p, size_t l)
 				vep_mark_skip(vep, p);
 				vep->in_esi_tag = 0;
 				vep->state = VEP_NEXTTAG;
+				if (vep->attr_vsb)
+					VSB_destroy(&vep->attr_vsb);
 			}
 
 		/******************************************************
@@ -885,6 +887,7 @@ VEP_Parse(struct vep_state *vep, const char *p, size_t l)
 				vep->state = VEP_TAGERROR;
 			}
 		} else if (vep->state == VEP_ATTRGETVAL) {
+			AZ(vep->attr_vsb);
 			vep->attr_vsb = VSB_new_auto();
 			vep->state = VEP_ATTRDELIM;
 		} else if (vep->state == VEP_ATTRDELIM) {



More information about the varnish-commit mailing list