mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Issue #25893: Removed unused variable reqdSize.
Added test for return code for the last RegQueryValueExW.
This commit is contained in:
parent
3dc74bf703
commit
e0cb9da9d6
1 changed files with 4 additions and 1 deletions
|
|
@ -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)
|
||||||
*/
|
*/
|
||||||
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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue