[master] 33523f0 Free decode object on failure

Federico G. Schwindt fgsch at lodoss.net
Mon Sep 11 22:57:04 UTC 2017


commit 33523f058765d566c92f2df4949624940eee44b9
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Mon Sep 11 23:25:18 2017 +0100

    Free decode object on failure
    
    To be revisited post release.

diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index c5d9530..4dc75f1 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -209,8 +209,10 @@ h2_kill_req(struct worker *wrk, const struct h2_sess *h2,
 			AZ(pthread_cond_signal(r2->cond));
 		r2 = NULL;
 	} else {
-		if (r2->state == H2_S_OPEN)
+		if (r2->state == H2_S_OPEN) {
 			(void)h2h_decode_fini(h2, r2->decode);
+			FREE_OBJ(r2->decode);
+		}
 	}
 	Lck_Unlock(&h2->sess->mtx);
 	if (r2 != NULL)
@@ -596,6 +598,7 @@ h2_rx_headers(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
 		VSLb(h2->vsl, SLT_Debug, "HPACK(hdr) %s", h2e->name);
 		Lck_Unlock(&h2->sess->mtx);
 		(void)h2h_decode_fini(h2, r2->decode);
+		FREE_OBJ(r2->decode);
 		AZ(r2->req->ws->r);
 		h2_del_req(wrk, r2);
 		return (h2e);
@@ -630,6 +633,7 @@ h2_rx_continuation(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
 		VSLb(h2->vsl, SLT_Debug, "HPACK(cont) %s", h2e->name);
 		Lck_Unlock(&h2->sess->mtx);
 		(void)h2h_decode_fini(h2, r2->decode);
+		FREE_OBJ(r2->decode);
 		AZ(r2->req->ws->r);
 		h2_del_req(wrk, r2);
 		return (h2e);


More information about the varnish-commit mailing list