提交 5583ee42 编写于 作者: G Ganlin Zhao

fix: coverity issues

CID: 400233
上级 6e548a96
...@@ -35,7 +35,7 @@ STSBuf* tsBufCreate(bool autoDelete, int32_t order) { ...@@ -35,7 +35,7 @@ STSBuf* tsBufCreate(bool autoDelete, int32_t order) {
// tscError("tmp file created failed since %s", terrstr()); // tscError("tmp file created failed since %s", terrstr());
return NULL; return NULL;
} }
STSBuf* pTSBuf = taosMemoryCalloc(1, sizeof(STSBuf)); STSBuf* pTSBuf = taosMemoryCalloc(1, sizeof(STSBuf));
if (pTSBuf == NULL) { if (pTSBuf == NULL) {
return NULL; return NULL;
...@@ -52,10 +52,13 @@ STSBuf* tsBufCreate(bool autoDelete, int32_t order) { ...@@ -52,10 +52,13 @@ STSBuf* tsBufCreate(bool autoDelete, int32_t order) {
} }
if (!autoDelete) { if (!autoDelete) {
taosRemoveFile(pTSBuf->path); if (taosRemoveFile(pTSBuf->path) == NULL) {
taosMemoryFree(pTSBuf);
return NULL;
}
} }
if (NULL == allocResForTSBuf(pTSBuf)) { if (allocResForTSBuf(pTSBuf) == NULL) {
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册