From: Serhiy Storchaka Date: Fri, 18 Dec 2015 07:54:19 +0000 (+0200) Subject: Issue #25893: Removed unused variable reqdSize. X-Git-Tag: v3.6.0a1~894^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0cb9da9d6dcb4aa7d8398f2b603311f2f63a12d;p=python Issue #25893: Removed unused variable reqdSize. Added test for return code for the last RegQueryValueExW. --- diff --git a/PC/getpathp.c b/PC/getpathp.c index 25b328b260..c7ddf1ea6b 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 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;