提交 603e31a5 编写于 作者: H Hui Li

[modify for coverity scan]

上级 1debfc0d
...@@ -433,7 +433,6 @@ void taosCacheEmpty(SCacheObj *pCacheObj) { ...@@ -433,7 +433,6 @@ void taosCacheEmpty(SCacheObj *pCacheObj) {
__cache_wr_lock(pCacheObj); __cache_wr_lock(pCacheObj);
while (taosHashIterNext(pIter)) { while (taosHashIterNext(pIter)) {
if (pCacheObj->deleting == 1) { if (pCacheObj->deleting == 1) {
taosHashDestroyIter(pIter);
break; break;
} }
......
...@@ -551,7 +551,7 @@ int tsDecompressTimestampImp(const char *const input, const int nelements, char ...@@ -551,7 +551,7 @@ int tsDecompressTimestampImp(const char *const input, const int nelements, char
delta_of_delta = 0; delta_of_delta = 0;
} else { } else {
if (is_bigendian()) { if (is_bigendian()) {
memcpy(&dd1 + LONG_BYTES - nbytes, input + ipos, nbytes); memcpy(((char *)(&dd1)) + LONG_BYTES - nbytes, input + ipos, nbytes);
} else { } else {
memcpy(&dd1, input + ipos, nbytes); memcpy(&dd1, input + ipos, nbytes);
} }
...@@ -576,7 +576,7 @@ int tsDecompressTimestampImp(const char *const input, const int nelements, char ...@@ -576,7 +576,7 @@ int tsDecompressTimestampImp(const char *const input, const int nelements, char
delta_of_delta = 0; delta_of_delta = 0;
} else { } else {
if (is_bigendian()) { if (is_bigendian()) {
memcpy(&dd2 + LONG_BYTES - nbytes, input + ipos, nbytes); memcpy(((char *)(&dd2)) + LONG_BYTES - nbytes, input + ipos, nbytes);
} else { } else {
memcpy(&dd2, input + ipos, nbytes); memcpy(&dd2, input + ipos, nbytes);
} }
......
...@@ -537,5 +537,6 @@ static int tdRestoreKVStore(SKVStore *pStore) { ...@@ -537,5 +537,6 @@ static int tdRestoreKVStore(SKVStore *pStore) {
_err: _err:
tfree(buf); tfree(buf);
taosHashDestroyIter(pIter);
return -1; return -1;
} }
\ No newline at end of file
...@@ -226,7 +226,7 @@ int taosOpenNoteWithMaxLines(char *fn, int maxLines, int maxNoteNum, taosNoteInf ...@@ -226,7 +226,7 @@ int taosOpenNoteWithMaxLines(char *fn, int maxLines, int maxNoteNum, taosNoteInf
void taosNotePrint(taosNoteInfo * pNote, const char * const format, ...) void taosNotePrint(taosNoteInfo * pNote, const char * const format, ...)
{ {
va_list argpointer; va_list argpointer;
char buffer[MAX_NOTE_LINE_SIZE]; char buffer[MAX_NOTE_LINE_SIZE+2];
int len; int len;
struct tm Tm, *ptm; struct tm Tm, *ptm;
struct timeval timeSecs; struct timeval timeSecs;
......
...@@ -278,7 +278,7 @@ int taosOpenUdpSocket(uint32_t ip, uint16_t port) { ...@@ -278,7 +278,7 @@ int taosOpenUdpSocket(uint32_t ip, uint16_t port) {
/* bind socket to local address */ /* bind socket to local address */
if (bind(sockFd, (struct sockaddr *)&localAddr, sizeof(localAddr)) < 0) { if (bind(sockFd, (struct sockaddr *)&localAddr, sizeof(localAddr)) < 0) {
uError("failed to bind udp socket: %d (%s), 0x%x:%hu", errno, strerror(errno), ip, port); uError("failed to bind udp socket: %d (%s), 0x%x:%hu", errno, strerror(errno), ip, port);
taosCloseSocket(sockFd); close(sockFd);
return -1; return -1;
} }
...@@ -321,7 +321,7 @@ int taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clientI ...@@ -321,7 +321,7 @@ int taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clientI
if (ret != 0) { if (ret != 0) {
//uError("failed to connect socket, ip:0x%x, port:%hu(%s)", destIp, destPort, strerror(errno)); //uError("failed to connect socket, ip:0x%x, port:%hu(%s)", destIp, destPort, strerror(errno));
taosCloseSocket(sockFd); close(sockFd);
sockFd = -1; sockFd = -1;
} }
......
...@@ -290,6 +290,7 @@ static void addToExpired(tmr_obj_t* head) { ...@@ -290,6 +290,7 @@ static void addToExpired(tmr_obj_t* head) {
SSchedMsg schedMsg; SSchedMsg schedMsg;
schedMsg.fp = NULL; schedMsg.fp = NULL;
schedMsg.tfp = processExpiredTimer; schedMsg.tfp = processExpiredTimer;
schedMsg.msg = NULL;
schedMsg.ahandle = head; schedMsg.ahandle = head;
schedMsg.thandle = NULL; schedMsg.thandle = NULL;
taosScheduleTask(tmrQhandle, &schedMsg); taosScheduleTask(tmrQhandle, &schedMsg);
......
...@@ -557,7 +557,7 @@ bool taosGetVersionNumber(char *versionStr, int *versionNubmer) { ...@@ -557,7 +557,7 @@ bool taosGetVersionNumber(char *versionStr, int *versionNubmer) {
return false; return false;
} }
int versionNumberPos[4] = {0}; int versionNumberPos[5] = {0};
int len = strlen(versionStr); int len = strlen(versionStr);
int dot = 0; int dot = 0;
for (int pos = 0; pos < len && dot < 4; ++pos) { for (int pos = 0; pos < len && dot < 4; ++pos) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册