mirror of
https://github.com/python/cpython
synced 2024-09-16 04:09:56 +00:00
Issue #25893: Removed unused variable reqdSize.
Added test for return code for the last RegQueryValueExW.
This commit is contained in:
commit
9bb0958b23
|
@ -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…
Reference in a new issue