From 25e3bde26490b353f7d75c39e23c2152c58bde69 Mon Sep 17 00:00:00 2001 From: XYWang Date: Fri, 28 May 2021 15:14:20 +0800 Subject: [PATCH] [TD-4384]: fixed an uninitialized bug --- src/plugins/http/src/httpUtil.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/http/src/httpUtil.c b/src/plugins/http/src/httpUtil.c index 399a33954d..a8031d3fd8 100644 --- a/src/plugins/http/src/httpUtil.c +++ b/src/plugins/http/src/httpUtil.c @@ -237,6 +237,11 @@ void httpFreeMultiCmds(HttpContext *pContext) { JsonBuf *httpMallocJsonBuf(HttpContext *pContext) { if (pContext->jsonBuf == NULL) { pContext->jsonBuf = (JsonBuf *)malloc(sizeof(JsonBuf)); + if (pContext->jsonBuf == NULL) { + return NULL; + } + + memset(pContext->jsonBuf, 0, sizeof(JsonBuf)); } if (!pContext->jsonBuf->pContext) { -- GitLab