summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-18 07:54:19 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-18 07:54:19 (GMT)
commite0cb9da9d6dcb4aa7d8398f2b603311f2f63a12d (patch)
tree010ffc835e79b8387aaa3b24330bbb3bbb3b6337 /PC
parent3dc74bf703d433a4060f6911ecfbc98be7ba267f (diff)
downloadcpython-e0cb9da9d6dcb4aa7d8398f2b603311f2f63a12d.zip
cpython-e0cb9da9d6dcb4aa7d8398f2b603311f2f63a12d.tar.gz
cpython-e0cb9da9d6dcb4aa7d8398f2b603311f2f63a12d.tar.bz2
Issue #25893: Removed unused variable reqdSize.
Added test for return code for the last RegQueryValueExW.
Diffstat (limited to 'PC')
-rw-r--r--PC/getpathp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c
index 25b328b..c7ddf1e 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -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;