From c427033a132f2e0eb5aa6e3891c371ca43a7f6fe Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Tue, 17 Mar 2020 22:43:24 +0800 Subject: [PATCH] minor bugs --- src/rpc/src/rpcMain.c | 2 +- src/util/src/tqueue.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 505fba94ce..7ce3b287fb 100755 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -287,7 +287,7 @@ void rpcClose(void *param) { (*taosCleanUpConn[pRpc->connType])(pRpc->udphandle); for (int i = 0; i < pRpc->sessions; ++i) { - if (pRpc->connList[i].user[0]) { + if (pRpc->connList && pRpc->connList[i].user[0]) { rpcCloseConn((void *)(pRpc->connList + i)); } } diff --git a/src/util/src/tqueue.c b/src/util/src/tqueue.c index ed69d7e7c4..f1db24b8ce 100644 --- a/src/util/src/tqueue.c +++ b/src/util/src/tqueue.c @@ -99,7 +99,7 @@ void taosFreeQitem(void *param) { int taosWriteQitem(taos_queue param, int type, void *item) { STaosQueue *queue = (STaosQueue *)param; - STaosQnode *pNode = (STaosQnode *)((char *)item - sizeof(STaosQnode)); + STaosQnode *pNode = (STaosQnode *)(((char *)item) - sizeof(STaosQnode)); pNode->type = type; pthread_mutex_lock(&queue->mutex); @@ -187,6 +187,7 @@ int taosGetQitem(taos_qall param, int *type, void **pitem) { if (pNode) { *pitem = pNode->item; + *type = pNode->type; num = 1; } -- GitLab