Commit e0cb9da9 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #25893: Removed unused variable reqdSize.

Added test for return code for the last RegQueryValueExW.
parent 3dc74bf7
...@@ -321,7 +321,6 @@ getpythonregpath(HKEY keyBase, int skipcore) ...@@ -321,7 +321,6 @@ getpythonregpath(HKEY keyBase, int skipcore)
dataBuf = PyMem_RawMalloc((dataSize+1) * sizeof(WCHAR)); dataBuf = PyMem_RawMalloc((dataSize+1) * sizeof(WCHAR));
if (dataBuf) { if (dataBuf) {
WCHAR *szCur = dataBuf; WCHAR *szCur = dataBuf;
DWORD reqdSize = dataSize;
/* Copy our collected strings */ /* Copy our collected strings */
for (index=0;index<numKeys;index++) { for (index=0;index<numKeys;index++) {
if (index > 0) { if (index > 0) {
...@@ -349,6 +348,10 @@ getpythonregpath(HKEY keyBase, int skipcore) ...@@ -349,6 +348,10 @@ getpythonregpath(HKEY keyBase, int skipcore)
*/ */
rc = RegQueryValueExW(newKey, NULL, 0, NULL, rc = RegQueryValueExW(newKey, NULL, 0, NULL,
(LPBYTE)szCur, &dataSize); (LPBYTE)szCur, &dataSize);
if (rc != ERROR_SUCCESS) {
PyMem_RawFree(dataBuf);
goto done;
}
} }
/* And set the result - caller must free */ /* And set the result - caller must free */
retval = dataBuf; retval = dataBuf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment