[TD-4384]<fix>: fixed an uninitialized bug

This commit is contained in:
XYWang 2021-05-28 15:14:20 +08:00
parent a8e97be5a2
commit 25e3bde264
1 changed files with 5 additions and 0 deletions

View File

@ -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) {