未验证 提交 f4685dc1 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

fix: gcc 12 compile error for 2.6 (#15062)

上级 181d1569
......@@ -60,7 +60,7 @@ static void DumpVector(const void* b, int n, size_t size, DumpState* D)
static void DumpString(const TString* s, DumpState* D)
{
if (s==NULL || getstr(s)==NULL)
if (s==NULL)
{
size_t size=0;
DumpVar(size,D);
......
......@@ -1169,12 +1169,12 @@ int parse_cloud_dsn() {
}
}
char *port = strstr(args.cloudHost, ":");
if ((port == NULL) || (port + strlen(":")) == NULL) {
if (port == NULL) {
fprintf(stderr, "Invalid format in TDengine cloud dsn: %s\n", args.cloudDsn);
return 1;
}
char *token = strstr(port + strlen(":"), "?token=");
if ((token == NULL) || (token + strlen("?token=")) == NULL ||
if ((token == NULL) ||
(strlen(token + strlen("?token=")) == 0)) {
fprintf(stderr, "Invalid format in TDengine cloud dsn: %s\n", args.cloudDsn);
return -1;
......@@ -1632,4 +1632,4 @@ void wsclient_query(char *command) {
}
cJSON_Delete(query);
return;
}
\ No newline at end of file
}
......@@ -361,8 +361,8 @@ void *rpcMallocCont(int contLen) {
void rpcFreeCont(void *cont) {
if (cont) {
char *temp = ((char *)cont) - sizeof(SRpcHead) - sizeof(SRpcReqContext);
free(temp);
tTrace("free mem: %p", temp);
free(temp);
}
}
......@@ -573,8 +573,8 @@ void rpcCancelRequest(int64_t rid) {
static void rpcFreeMsg(void *msg) {
if ( msg ) {
char *temp = (char *)msg - sizeof(SRpcReqContext);
free(temp);
tTrace("free mem: %p", temp);
free(temp);
}
}
......@@ -1683,4 +1683,4 @@ int32_t rpcUnusedSession(void * rpcInfo, bool bLock) {
if(info == NULL)
return 0;
return taosIdPoolNumOfFree(info->idPool, bLock);
}
\ No newline at end of file
}
......@@ -86,9 +86,8 @@ void taosCloseQueue(taos_queue param) {
}
pthread_mutex_destroy(&queue->mutex);
free(queue);
uTrace("queue:%p is closed", queue);
free(queue);
}
void *taosAllocateQitem(int size) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册