fix: fix address sanitizer error

This commit is contained in:
slzhou 2023-09-19 08:27:20 +08:00
parent 00c0f34d66
commit 29cdc8bb55
1 changed files with 2 additions and 4 deletions

View File

@ -35,9 +35,7 @@
if(tDecodeIsEnd(&decoder)){ \
if(tDecodeI32(&decoder, &pReq->sqlLen) < 0) return -1; \
if(pReq->sqlLen > 0){ \
pReq->sql = taosMemoryCalloc(1, pReq->sqlLen + 1); \
if (pReq->sql == NULL) return -1; \
if (tDecodeCStrTo(&decoder, pReq->sql) < 0) return -1; \
if (tDecodeBinaryAlloc(&decoder, (void **)&pReq->sql, NULL) < 0) return -1; \
} \
} \
} while (0)
@ -46,7 +44,7 @@
do { \
if (tEncodeI32(&encoder, pReq->sqlLen) < 0) return -1; \
if (pReq->sqlLen > 0){ \
if (tEncodeCStr(&encoder, pReq->sql) < 0) return -1; \
if (tEncodeBinary(&encoder, pReq->sql, pReq->sqlLen) < 0) return -1; \
} \
} while (0)