Skip to content

Commit

Permalink
Issue python#25893: Removed unused variable reqdSize.
Browse files Browse the repository at this point in the history
Added test for return code for the last RegQueryValueExW.
  • Loading branch information
serhiy-storchaka committed Dec 18, 2015
1 parent 3dc74bf commit e0cb9da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PC/getpathp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e0cb9da

Please sign in to comment.