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