From 6befacdc143565e4069393469c151b761c1ef9af Mon Sep 17 00:00:00 2001 From: honghecun Date: Tue, 2 Sep 2025 09:38:38 +0800 Subject: [PATCH] initialize the new allocated memories Signed-off-by: honghecun --- interfaces/native/innerkits/hisysevent_easy/hisysevent_easy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interfaces/native/innerkits/hisysevent_easy/hisysevent_easy.c b/interfaces/native/innerkits/hisysevent_easy/hisysevent_easy.c index c910092..93a8715 100644 --- a/interfaces/native/innerkits/hisysevent_easy/hisysevent_easy.c +++ b/interfaces/native/innerkits/hisysevent_easy/hisysevent_easy.c @@ -93,6 +93,7 @@ static int GetRealPid(void) } char buf[LINE_BUF_SIZE]; + (void)memset_s(buf, sizeof(buf), 0, sizeof(buf)); int pos = 0; char curChar = 0; while (1) { @@ -106,7 +107,7 @@ static int GetRealPid(void) break; } pos = 0; - (void)memset_s(buf, sizeof(buf), '\0', sizeof(buf)); + (void)memset_s(buf, sizeof(buf), 0, sizeof(buf)); continue; } buf[pos] = curChar; -- Gitee