Revision: 10367 https://osdn.net/projects/ttssh2/scm/svn/commits/10367 Author: zmatsuo Date: 2022-11-19 11:28:11 +0900 (Sat, 19 Nov 2022) Log Message: ----------- gcc/clangでビルドエラー - error: jump to label 'finish' note: crosses initialization of 'BYTE* p' Modified Paths: -------------- trunk/teraterm/common/win32helper.cpp -------------- next part -------------- Modified: trunk/teraterm/common/win32helper.cpp =================================================================== --- trunk/teraterm/common/win32helper.cpp 2022-11-15 13:48:37 UTC (rev 10366) +++ trunk/teraterm/common/win32helper.cpp 2022-11-19 02:28:11 UTC (rev 10367) @@ -288,6 +288,7 @@ LSTATUS hRegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, void **lpData, LPDWORD lpcbData) { + BYTE *p; DWORD len; LSTATUS r = RegQueryValueExW(hKey, lpValueName, lpReserved, lpType, NULL, &len); if (r != ERROR_SUCCESS) { @@ -294,7 +295,7 @@ *lpData = NULL; goto finish; } - BYTE *p = (BYTE *)malloc(len); + p = (BYTE *)malloc(len); r = RegQueryValueExW(hKey, lpValueName, lpReserved, lpType, p, &len); if (r != ERROR_SUCCESS) { free(p);