fix: Memory detection in macro definition
This commit is contained in:
parent
f684e12c27
commit
e87bd926da
|
@ -81,8 +81,11 @@ int32_t taosResetTerminalMode();
|
||||||
unw_get_reg(&cursor, UNW_REG_IP, &pc); \
|
unw_get_reg(&cursor, UNW_REG_IP, &pc); \
|
||||||
fname[0] = '\0'; \
|
fname[0] = '\0'; \
|
||||||
(void)unw_get_proc_name(&cursor, fname, sizeof(fname), &offset); \
|
(void)unw_get_proc_name(&cursor, fname, sizeof(fname), &offset); \
|
||||||
size += 1; \
|
|
||||||
array[size] = (char *)taosMemoryMalloc(sizeof(char) * STACKSIZE + 1); \
|
array[size] = (char *)taosMemoryMalloc(sizeof(char) * STACKSIZE + 1); \
|
||||||
|
if(NULL == array[size]) { \
|
||||||
|
break; \
|
||||||
|
} \
|
||||||
|
size += 1; \
|
||||||
snprintf(array[size], STACKSIZE, "0x%lx : (%s+0x%lx) [0x%lx]\n", (long)pc, fname, (long)offset, (long)pc); \
|
snprintf(array[size], STACKSIZE, "0x%lx : (%s+0x%lx) [0x%lx]\n", (long)pc, fname, (long)offset, (long)pc); \
|
||||||
} \
|
} \
|
||||||
if (ignoreNum < size && size > 0) { \
|
if (ignoreNum < size && size > 0) { \
|
||||||
|
|
Loading…
Reference in New Issue