diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-18 07:54:59 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-18 07:54:59 (GMT) |
commit | 9bb0958b23c662e1a709322411a18843805e90d8 (patch) | |
tree | 3a9bdde17702dbc12efec92ecf9d01dab091e3a6 /PC | |
parent | 7f955ab16a92ec4cb1494ca765cfbfb29df8b5f5 (diff) | |
parent | e0cb9da9d6dcb4aa7d8398f2b603311f2f63a12d (diff) | |
download | cpython-9bb0958b23c662e1a709322411a18843805e90d8.zip cpython-9bb0958b23c662e1a709322411a18843805e90d8.tar.gz cpython-9bb0958b23c662e1a709322411a18843805e90d8.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.c | 5 |
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; |