[Python-checkins] cpython (merge 3.5 -> default): Issue #25893: Removed unused variable reqdSize.

serhiy.storchaka python-checkins at python.org
Fri Dec 18 02:55:18 EST 2015


https://hg.python.org/cpython/rev/b72736cfc904
changeset: 99612:b72736cfc904
parent: 99610:c11bdccc4547
parent: 99611:12ca4a3695f9
user: Serhiy Storchaka <storchaka at gmail.com>
date: Fri Dec 18 09:54:59 2015 +0200
summary:
 Issue #25893: Removed unused variable reqdSize.
Added test for return code for the last RegQueryValueExW.
files:
 PC/getpathp.c | 5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/PC/getpathp.c b/PC/getpathp.c
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -321,7 +321,6 @@
 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 @@
 */
 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;
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /