Issue #25893: Removed unused variable reqdSize.

Added test for return code for the last RegQueryValueExW.
This commit is contained in:
Serhiy Storchaka 2015-12-18 09:54:59 +02:00
commit 9bb0958b23

View file

@ -321,7 +321,6 @@ getpythonregpath(HKEY keyBase, int skipcore)
dataBuf = PyMem_RawMalloc((dataSize+1) * sizeof(WCHAR));
if (dataBuf) {
WCHAR *szCur = dataBuf;
DWORD reqdSize = dataSize;
/* Copy our collected strings */
for (index=0;index<numKeys;index++) {
if (index > 0) {
@ -349,6 +348,10 @@ getpythonregpath(HKEY keyBase, int skipcore)
*/
rc = RegQueryValueExW(newKey, NULL, 0, NULL,
(LPBYTE)szCur, &dataSize);
if (rc != ERROR_SUCCESS) {
PyMem_RawFree(dataBuf);
goto done;
}
}
/* And set the result - caller must free */
retval = dataBuf;