]> granicus.if.org Git - python/commitdiff
Merged revisions 81847 via svnmerge from
authorBrian Curtin <brian.curtin@gmail.com>
Tue, 8 Jun 2010 21:17:16 +0000 (21:17 +0000)
committerBrian Curtin <brian.curtin@gmail.com>
Tue, 8 Jun 2010 21:17:16 +0000 (21:17 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81847 | brian.curtin | 2010-06-08 16:15:06 -0500 (Tue, 08 Jun 2010) | 3 lines

  Move a variable declration outside of a loop to match what was
  done in r81843 for py3k.
........

PC/_winreg.c

index eac596e2f33cfa1cd9b1710400fe63dd06a9f9c8..293f1dddcadffb2d17778888473906c7a69f31ad 100644 (file)
@@ -1105,6 +1105,7 @@ PyEnumValue(PyObject *self, PyObject *args)
     long rc;
     char *retValueBuf;
     char *retDataBuf;
+    char *tmpBuf;
     DWORD retValueSize, bufValueSize;
     DWORD retDataSize, bufDataSize;
     DWORD typ;
@@ -1136,7 +1137,6 @@ PyEnumValue(PyObject *self, PyObject *args)
     }
 
     while (1) {
-        char *tmp;
         Py_BEGIN_ALLOW_THREADS
         rc = RegEnumValue(hKey,
                   index,
@@ -1152,13 +1152,13 @@ PyEnumValue(PyObject *self, PyObject *args)
             break;
 
         bufDataSize *= 2;
-        tmp = (char *)PyMem_Realloc(retDataBuf, bufDataSize);
-        if (tmp == NULL) {
+        tmpBuf = (char *)PyMem_Realloc(retDataBuf, bufDataSize);
+        if (tmpBuf == NULL) {
             PyErr_NoMemory();
             retVal = NULL;
             goto fail;
         }
-        retDataBuf = tmp;
+        retDataBuf = tmpBuf;
         retDataSize = bufDataSize;
         retValueSize = bufValueSize;
     }