fix invalid read
This commit is contained in:
parent
28dbe36b91
commit
5a684f2a26
|
@ -316,8 +316,13 @@ void mndUpdateIpWhiteForAllUser(SMnode *pMnode, char *user, char *fqdn, int8_t t
|
||||||
|
|
||||||
void *pIter = taosHashIterate(ipWhiteMgt.pIpWhiteTab, NULL);
|
void *pIter = taosHashIterate(ipWhiteMgt.pIpWhiteTab, NULL);
|
||||||
while (pIter) {
|
while (pIter) {
|
||||||
char *key = taosHashGetKey(pIter, NULL);
|
size_t klen = 0;
|
||||||
update |= mndUpdateIpWhiteImpl(ipWhiteMgt.pIpWhiteTab, key, fqdn, type);
|
char *key = taosHashGetKey(pIter, &klen);
|
||||||
|
|
||||||
|
char *keyDup = taosMemoryCalloc(1, klen + 1);
|
||||||
|
memcpy(keyDup, key, klen);
|
||||||
|
update |= mndUpdateIpWhiteImpl(ipWhiteMgt.pIpWhiteTab, keyDup, fqdn, type);
|
||||||
|
taosMemoryFree(keyDup);
|
||||||
|
|
||||||
pIter = taosHashIterate(ipWhiteMgt.pIpWhiteTab, pIter);
|
pIter = taosHashIterate(ipWhiteMgt.pIpWhiteTab, pIter);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue