From 6432dc87837c95f5364365bf499f4848f8a1e36e Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 30 Jan 2019 15:42:44 +0100 Subject: [PATCH] CLEANUP: mux-h2: remove misleading leftover test on h2s' nullity The WINDOW_UPDATE and DATA frame handlers used to still have a check on h2s to return either h2s_error() or h2c_error(). This is a leftover from the early code. The h2s cannot be null there anymore as it has already been dereferenced before reaching these locations. --- src/mux_h2.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/mux_h2.c b/src/mux_h2.c index 8f8c37b4d..4019ec1f7 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -1771,12 +1771,8 @@ static int h2c_handle_window_update(struct h2c *h2c, struct h2s *h2s) return 0; strm_err: - if (h2s) { - h2s_error(h2s, error); - h2c->st0 = H2_CS_FRAME_E; - } - else - h2c_error(h2c, error); + h2s_error(h2s, error); + h2c->st0 = H2_CS_FRAME_E; return 0; } @@ -2143,12 +2139,8 @@ static int h2c_frt_handle_data(struct h2c *h2c, struct h2s *h2s) return 0; strm_err: - if (h2s) { - h2s_error(h2s, error); - h2c->st0 = H2_CS_FRAME_E; - } - else - h2c_error(h2c, error); + h2s_error(h2s, error); + h2c->st0 = H2_CS_FRAME_E; return 0; }