Merge pull request #29117 from taosdata/fix/fixCompileError

fix compile error
This commit is contained in:
Shengliang Guan 2024-12-12 17:31:32 +08:00 committed by GitHub
commit 4fe6d9b878
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -4627,11 +4627,12 @@ int32_t compareHashTableImpl(SHashObj* p1, SHashObj* p2, SArray* diff) {
while (pIter) {
char* name = taosHashGetKey(pIter, &len);
if (!isBkdDataMeta(name, len) && !taosHashGet(p1, name, len)) {
char* fname = taosMemoryCalloc(1, len + 1);
int32_t cap = len + 1;
char* fname = taosMemoryCalloc(1, cap);
if (fname == NULL) {
return terrno;
}
tstrncpy(fname, name, strlen(name));
tstrncpy(fname, name, cap);
if (taosArrayPush(diff, &fname) == NULL) {
taosMemoryFree(fname);
return terrno;
@ -4819,13 +4820,14 @@ int32_t dbChkpGetDelta(SDbChkp* p, int64_t chkpId, SArray* list) {
size_t len = 0;
char* name = taosHashGetKey(pIter, &len);
if (name != NULL && !isBkdDataMeta(name, len)) {
char* fname = taosMemoryCalloc(1, len + 1);
int32_t cap = len + 1;
char* fname = taosMemoryCalloc(1, cap);
if (fname == NULL) {
TAOS_UNUSED(taosThreadRwlockUnlock(&p->rwLock));
return terrno;
}
tstrncpy(fname, name, strlen(name));
tstrncpy(fname, name, cap);
if (taosArrayPush(p->pAdd, &fname) == NULL) {
taosMemoryFree(fname);
TAOS_UNUSED(taosThreadRwlockUnlock(&p->rwLock));