未验证 提交 549bce34 编写于 作者: wafwerar's avatar wafwerar 提交者: GitHub

Merge pull request #11027 from taosdata/fix/ZhiqiangWang/TD-13758-allow-double-free

[TD-13758]<fix>: allow double free.
......@@ -40,7 +40,7 @@ enum TdTimezone
TdWestZone3,
TdWestZone2,
TdWestZone1,
TdZeroZero,
TdZeroZone,
TdEastZone1,
TdEastZone2,
TdEastZone3,
......
......@@ -27,7 +27,7 @@ SDiskSpace tsLogSpace = {0};
SDiskSpace tsTempSpace = {0};
char tsOsName[16] = {0};
char tsTimezoneStr[TD_TIMEZONE_LEN] = {0};
enum TdTimezone tsTimezone = TdZeroZero;
enum TdTimezone tsTimezone = TdZeroZone;
char tsLocale[TD_LOCALE_LEN] = {0};
char tsCharset[TD_CHARSET_LEN] = {0};
int8_t tsDaylight = 0;
......
......@@ -115,7 +115,8 @@ void taosMemoryFree(const void *ptr) {
TdMemoryInfoPtr pTdMemoryInfo = (TdMemoryInfoPtr)((char*)ptr - sizeof(TdMemoryInfo));
if(pTdMemoryInfo->symbol == TD_MEMORY_SYMBOL) {
memset(pTdMemoryInfo, 0, sizeof(TdMemoryInfo));
pTdMemoryInfo->memorySize = 0;
// memset(pTdMemoryInfo, 0, sizeof(TdMemoryInfo));
free(pTdMemoryInfo);
} else {
free((void*)ptr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册