From 616a664f8e0dee1377e69f9d9d32f17f799c1473 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Wed, 31 Jul 2024 09:49:19 +0900 Subject: [PATCH] utils: Initialize with NULL Signed-off-by: Hiroshi Hatake --- ext/winevt/winevt_utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/winevt/winevt_utils.cpp b/ext/winevt/winevt_utils.cpp index a8870fb..0c47f24 100644 --- a/ext/winevt/winevt_utils.cpp +++ b/ext/winevt/winevt_utils.cpp @@ -631,7 +631,7 @@ static int ExpandSIDWString(PSID sid, CHAR **out_expanded) SID_NAME_USE sid_type = SidTypeUnknown; WCHAR wAccount[MAX_NAME]; WCHAR wDomain[MAX_NAME]; - CHAR *account, *domain; + CHAR *account = NULL, *domain = NULL; DWORD result_len = 0; CHAR *formatted = NULL; VALUE vformatted; @@ -889,7 +889,7 @@ render_system_event(EVT_HANDLE hEvent, BOOL preserve_qualifiers, BOOL preserveSI if (EvtVarTypeNull != pRenderedValues[EvtSystemUserID].Type) { if (ConvertSidToStringSid(pRenderedValues[EvtSystemUserID].SidVal, &pwsSid)) { - CHAR *expandSID; + CHAR *expandSID = NULL; if (preserveSID_p) { rbstr = rb_utf8_str_new_cstr(pwsSid); rb_hash_aset(hash, rb_str_new2("UserID"), rbstr);