From a718613944e4caa969d3a13d69eaee2a5effab79 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 26 Nov 2022 13:02:15 +0800 Subject: [PATCH] fix: coverity issues --- source/os/src/osTimezone.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/os/src/osTimezone.c b/source/os/src/osTimezone.c index 4835f6d1c8..ab5600744c 100644 --- a/source/os/src/osTimezone.c +++ b/source/os/src/osTimezone.c @@ -745,8 +745,7 @@ void taosSetSystemTimezone(const char *inTimezoneStr, char *outTimezoneStr, int8 if (inTimezoneStr == NULL || inTimezoneStr[0] == 0) return; size_t len = strlen(inTimezoneStr); - char *buf = taosMemoryMalloc(len + 1); - memset(buf, 0, len + 1) + char *buf = taosMemoryCalloc(len + 1, 1); for (int32_t i = 0; i < len; i++) { if (inTimezoneStr[i] == ' ' || inTimezoneStr[i] == '(') { buf[i] = 0; -- GitLab