diff --git a/source/client/src/clientStmt2.c b/source/client/src/clientStmt2.c index dba6aa3beb..8909eb6ccb 100644 --- a/source/client/src/clientStmt2.c +++ b/source/client/src/clientStmt2.c @@ -77,7 +77,7 @@ static int32_t stmtCreateRequest(STscStmt2* pStmt) { } if (pStmt->db != NULL) { taosMemoryFreeClear(pStmt->exec.pRequest->pDb); - pStmt->exec.pRequest->pDb = strdup(pStmt->db); + pStmt->exec.pRequest->pDb = taosStrdup(pStmt->db); } if (TSDB_CODE_SUCCESS == code) { pStmt->exec.pRequest->syncQuery = true;