Merge pull request #5107 from taosdata/hotfix/TD-2904

fix mem leak
This commit is contained in:
haojun Liao 2021-02-03 18:08:30 +08:00 committed by GitHub
commit 0878c239f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -908,6 +908,7 @@ int main(int argc, char *argv[]) {
} }
pthread_join(read_id, NULL); pthread_join(read_id, NULL);
taos_close(rInfo->taos); taos_close(rInfo->taos);
free(rInfo);
} }
taos_cleanup(); taos_cleanup();

View File

@ -279,7 +279,7 @@ tSQLExpr *tSqlExprCreate(tSQLExpr *pLeft, tSQLExpr *pRight, int32_t optrType) {
pExpr->nSQLOptr = optrType; pExpr->nSQLOptr = optrType;
pExpr->pLeft = pLeft; pExpr->pLeft = pLeft;
if (pRight == NULL) { if (pLeft != NULL && pRight == NULL) {
pRight = calloc(1, sizeof(tSQLExpr)); pRight = calloc(1, sizeof(tSQLExpr));
} }