Merge pull request #20093 from taosdata/fix/freeNullBatch
fix: fix invalid free
This commit is contained in:
commit
dd99a45013
|
@ -160,7 +160,6 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp
|
|||
dGError("vgId:%d, msg:%p failed to put into vnode queue since %s, type:%s qtype:%d contLen:%d", pHead->vgId, pMsg,
|
||||
terrstr(), TMSG_INFO(pMsg->msgType), qtype, pHead->contLen);
|
||||
terrno = (terrno != 0) ? terrno : -1;
|
||||
vmSendResponse(pMsg);
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef USE_UV
|
||||
|
||||
#include "transComm.h"
|
||||
|
||||
void* (*taosInitHandle[])(uint32_t ip, uint32_t port, char* label, int32_t numOfThreads, void* fp, void* shandle) = {
|
||||
|
@ -88,6 +86,11 @@ void* rpcOpen(const SRpcInit* pInit) {
|
|||
|
||||
pRpc->connType = pInit->connType;
|
||||
pRpc->idleTime = pInit->idleTime;
|
||||
pRpc->parent = pInit->parent;
|
||||
if (pInit->user) {
|
||||
tstrncpy(pRpc->user, pInit->user, sizeof(pRpc->user));
|
||||
}
|
||||
|
||||
pRpc->tcphandle =
|
||||
(*taosInitHandle[pRpc->connType])(ip, pInit->localPort, pRpc->label, pRpc->numOfThreads, NULL, pRpc);
|
||||
|
||||
|
@ -95,10 +98,6 @@ void* rpcOpen(const SRpcInit* pInit) {
|
|||
taosMemoryFree(pRpc);
|
||||
return NULL;
|
||||
}
|
||||
pRpc->parent = pInit->parent;
|
||||
if (pInit->user) {
|
||||
tstrncpy(pRpc->user, pInit->user, sizeof(pRpc->user));
|
||||
}
|
||||
|
||||
int64_t refId = transAddExHandle(transGetInstMgt(), pRpc);
|
||||
transAcquireExHandle(transGetInstMgt(), refId);
|
||||
|
@ -188,5 +187,3 @@ void rpcCleanup(void) {
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -985,6 +985,7 @@ _RETURN:
|
|||
}
|
||||
|
||||
static void cliDestroyBatch(SCliBatch* pBatch) {
|
||||
if (pBatch == NULL) return;
|
||||
while (!QUEUE_IS_EMPTY(&pBatch->wq)) {
|
||||
queue* h = QUEUE_HEAD(&pBatch->wq);
|
||||
QUEUE_REMOVE(h);
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifdef USE_UV
|
||||
|
||||
#include "transComm.h"
|
||||
|
||||
|
@ -67,7 +66,7 @@ int32_t transDecompressMsg(char** msg, int32_t len) {
|
|||
|
||||
char* buf = taosMemoryCalloc(1, oriLen + sizeof(STransMsgHead));
|
||||
STransMsgHead* pNewHead = (STransMsgHead*)buf;
|
||||
int32_t decompLen = LZ4_decompress_safe(pCont + sizeof(STransCompMsg), pNewHead->content,
|
||||
int32_t decompLen = LZ4_decompress_safe(pCont + sizeof(STransCompMsg), (char*)pNewHead->content,
|
||||
len - sizeof(STransMsgHead) - sizeof(STransCompMsg), oriLen);
|
||||
memcpy((char*)pNewHead, (char*)pHead, sizeof(STransMsgHead));
|
||||
|
||||
|
@ -655,4 +654,3 @@ void transDestoryExHandle(void* handle) {
|
|||
}
|
||||
taosMemoryFree(handle);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue