]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Move a variable declration outside of a loop to match what was
authorBrian Curtin <brian.curtin@gmail.com>
Tue, 8 Jun 2010 21:15:06 +0000 (21:15 +0000)
committerBrian Curtin <brian.curtin@gmail.com>
Tue, 8 Jun 2010 21:15:06 +0000 (21:15 +0000)
done in r81843 for py3k.

PC/_winreg.c

index d3c39f91eac9848eacde3697fdcd1e67680a5280..445c3edd76e04c2b2942436d5dd0404de4cdda14 100644 (file)
@@ -1187,6 +1187,7 @@ PyEnumValue(PyObject *self, PyObject *args)
     long rc;
     char *retValueBuf;
     char *retDataBuf;
+    char *tmpBuf;
     DWORD retValueSize, bufValueSize;
     DWORD retDataSize, bufDataSize;
     DWORD typ;
@@ -1218,7 +1219,6 @@ PyEnumValue(PyObject *self, PyObject *args)
     }
 
     while (1) {
-        char *tmp;
         Py_BEGIN_ALLOW_THREADS
         rc = RegEnumValue(hKey,
                   index,
@@ -1234,13 +1234,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;
     }