Merge pull request #5186 from taosdata/fix/TD-2962

[TD-2962]<fix>: fix pContext NULL crash
This commit is contained in:
Shengliang Guan 2021-02-07 23:27:36 +08:00 committed by GitHub
commit 677494b078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -239,6 +239,10 @@ JsonBuf *httpMallocJsonBuf(HttpContext *pContext) {
pContext->jsonBuf = (JsonBuf *)malloc(sizeof(JsonBuf));
}
if (!pContext->jsonBuf->pContext) {
pContext->jsonBuf->pContext = pContext;
}
return pContext->jsonBuf;
}