[td-225]add check for malloc failure.
This commit is contained in:
parent
6a9b2e6455
commit
c0dfdc9c73
|
@ -477,6 +477,10 @@ static STsdbQueryHandle* tsdbQueryTablesImpl(STsdbRepo* tsdb, STsdbQueryCond* pC
|
|||
|
||||
TsdbQueryHandleT* tsdbQueryTables(STsdbRepo* tsdb, STsdbQueryCond* pCond, STableGroupInfo* groupList, uint64_t qId, SMemRef* pRef) {
|
||||
STsdbQueryHandle* pQueryHandle = tsdbQueryTablesImpl(tsdb, pCond, qId, pRef);
|
||||
if (pQueryHandle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (emptyQueryTimewindow(pQueryHandle)) {
|
||||
return (TsdbQueryHandleT*) pQueryHandle;
|
||||
}
|
||||
|
@ -587,6 +591,10 @@ TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STable
|
|||
}
|
||||
|
||||
STsdbQueryHandle *pQueryHandle = (STsdbQueryHandle*) tsdbQueryTables(tsdb, pCond, groupList, qId, pMemRef);
|
||||
if (pQueryHandle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int32_t code = checkForCachedLastRow(pQueryHandle, groupList);
|
||||
if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0
|
||||
terrno = code;
|
||||
|
@ -604,6 +612,10 @@ TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STable
|
|||
|
||||
TsdbQueryHandleT tsdbQueryCacheLast(STsdbRepo *tsdb, STsdbQueryCond *pCond, STableGroupInfo *groupList, uint64_t qId, SMemRef* pMemRef) {
|
||||
STsdbQueryHandle *pQueryHandle = (STsdbQueryHandle*) tsdbQueryTables(tsdb, pCond, groupList, qId, pMemRef);
|
||||
if (pQueryHandle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int32_t code = checkForCachedLast(pQueryHandle);
|
||||
if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0
|
||||
terrno = code;
|
||||
|
|
Loading…
Reference in New Issue