[master] 9796bd9 Fix (insignificant) memory leak with mal-formed ESI directives.
Poul-Henning Kamp
phk at FreeBSD.org
Tue Apr 19 18:36:05 CEST 2016
commit 9796bd939173e5ddc9bb3b26e5731c19fe776ccd
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 6ba5eb1..815bac4 100644
--- a/bin/varnishd/cache/cache_esi_parse.c
+++ b/bin/varnishd/cache/cache_esi_parse.c
@@ -820,6 +820,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);
}
/******************************************************
@@ -854,6 +856,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