[Python-checkins] cpython (3.5): 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/12ca4a3695f9
changeset:   99611:12ca4a3695f9
branch:      3.5
parent:      99609:aa79b2a5b2e1
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Dec 18 09:54:19 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