[master] c4298f9 Make sure to not leak memory, even when we're out of it.

Poul-Henning Kamp phk at FreeBSD.org
Wed Jul 9 18:12:35 CEST 2014


commit c4298f9fc20deb6ef7254f70044e478bf9fd40de
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jul 9 16:12:14 2014 +0000

    Make sure to not leak memory, even when we're out of it.

diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index d020bc0..c0f2859 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -467,9 +467,9 @@ vfp_gzip_init(struct busyobj *bo, struct vfp_entry *vfe)
 		vg = VGZ_NewUngzip(bo->vsl, vfe->vfp->priv1);
 	if (vg == NULL)
 		return (VFP_ERROR);
+	vfe->priv1 = vg;
 	if (vgz_getmbuf(vg))
 		return (VFP_ERROR);
-	vfe->priv1 = vg;
 	VGZ_Ibuf(vg, vg->m_buf, 0);
 	AZ(vg->m_len);
 	return (VFP_OK);



More information about the varnish-commit mailing list