enh: code optimization for tbase58
This commit is contained in:
parent
5b0fc1544d
commit
75caea4fbf
|
@ -145,7 +145,7 @@ uint8_t *base58_decode(const char *value, size_t inlen, int32_t *outlen) {
|
||||||
const uint8_t *it = pbuf + (size - len);
|
const uint8_t *it = pbuf + (size - len);
|
||||||
while (it != pbuf + size && *it == 0) ++it;
|
while (it != pbuf + size && *it == 0) ++it;
|
||||||
|
|
||||||
uint8_t *result = taosMemoryCalloc(1, inlen + 1);
|
uint8_t *result = taosMemoryCalloc(1, nz + (pbuf + size - it) + 1);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
if (bfree) taosMemoryFree(pbuf);
|
if (bfree) taosMemoryFree(pbuf);
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
|
Loading…
Reference in New Issue