summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
Diffstat (limited to 'PC')
-rw-r--r--PC/winreg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index 3b9693c..3347eb7 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -943,8 +943,10 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
fixupMultiSZ(str, data, len);
obData = PyList_New(s);
- if (obData == NULL)
+ if (obData == NULL) {
+ free(str);
return NULL;
+ }
for (index = 0; index < s; index++)
{
size_t len = wcslen(str[index]);
@@ -952,6 +954,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
PyErr_SetString(PyExc_OverflowError,
"registry string is too long for a Python string");
Py_DECREF(obData);
+ free(str);
return NULL;
}
PyList_SetItem(obData,