From c83afd5a08b246b62ee9627e04c95929095fdf5e Mon Sep 17 00:00:00 2001 From: Kit Chan Date: Thu, 24 Aug 2023 16:40:56 -0700 Subject: [PATCH] Fix CID 1508979: unchecked return value --- plugins/lua/ts_lua_util.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/lua/ts_lua_util.cc b/plugins/lua/ts_lua_util.cc index 7eacada39cf..94150d9b09c 100644 --- a/plugins/lua/ts_lua_util.cc +++ b/plugins/lua/ts_lua_util.cc @@ -53,7 +53,10 @@ void ts_lua_update_server_response_hdrp(ts_lua_http_ctx *http_ctx) { if (http_ctx->server_response_hdrp) { - TSHttpTxnServerRespGet(http_ctx->txnp, &http_ctx->server_response_bufp, &http_ctx->server_response_hdrp); + if (TSHttpTxnServerRespGet(http_ctx->txnp, &http_ctx->server_response_bufp, &http_ctx->server_response_hdrp) != TS_SUCCESS) { + TSError("[ts_lua][%s] failed to get server response", __FUNCTION__); + return; + } } }