diff options
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 c321d9f..52d230e 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -1036,6 +1036,7 @@ PyEnumValue(PyObject *self, PyObject *args) int index; long rc; wchar_t *retValueBuf; + wchar_t *tmpBuf; BYTE *retDataBuf; DWORD retValueSize, bufValueSize; DWORD retDataSize, bufDataSize; @@ -1068,7 +1069,6 @@ PyEnumValue(PyObject *self, PyObject *args) } while (1) { - wchar_t *tmp; Py_BEGIN_ALLOW_THREADS rc = RegEnumValueW(hKey, index, @@ -1084,13 +1084,13 @@ PyEnumValue(PyObject *self, PyObject *args) break; bufDataSize *= 2; - tmp = (char *)PyMem_Realloc(retDataBuf, bufDataSize); - if (tmp == NULL) { + tmpBuf = (wchar_t *)PyMem_Realloc(retDataBuf, bufDataSize); + if (tmpBuf == NULL) { PyErr_NoMemory(); retVal = NULL; goto fail; } - retDataBuf = tmp; + retDataBuf = tmpBuf; retDataSize = bufDataSize; retValueSize = bufValueSize; } |