diff options
author | Brian Curtin <brian.curtin@gmail.com> | 2010-06-08 21:17:16 (GMT) |
---|---|---|
committer | Brian Curtin <brian.curtin@gmail.com> | 2010-06-08 21:17:16 (GMT) |
commit | 46a955b45a7f93dc8e51ed921dc0690381b17270 (patch) | |
tree | 424a9a18f2a83e76be619b55b9294bf3129224a5 /PC | |
parent | 856333605a87d0f43cb6dff81638922b3393a3df (diff) | |
download | cpython-46a955b45a7f93dc8e51ed921dc0690381b17270.zip cpython-46a955b45a7f93dc8e51ed921dc0690381b17270.tar.gz cpython-46a955b45a7f93dc8e51ed921dc0690381b17270.tar.bz2 |
Merged revisions 81847 via svnmerge from
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.
........
Diffstat (limited to 'PC')
-rw-r--r-- | PC/_winreg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/PC/_winreg.c b/PC/_winreg.c index eac596e..293f1dd 100644 --- a/PC/_winreg.c +++ b/PC/_winreg.c @@ -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; } |