diff options
Diffstat (limited to 'Mac/Modules/cf')
-rw-r--r-- | Mac/Modules/cf/_CFmodule.c | 1 | ||||
-rw-r--r-- | Mac/Modules/cf/cfsupport.py | 1 | ||||
-rw-r--r-- | Mac/Modules/cf/pycfbridge.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/Mac/Modules/cf/_CFmodule.c b/Mac/Modules/cf/_CFmodule.c index da92564..691a636 100644 --- a/Mac/Modules/cf/_CFmodule.c +++ b/Mac/Modules/cf/_CFmodule.c @@ -1821,6 +1821,7 @@ int CFStringRefObj_Convert(PyObject *v, CFStringRef *p_itself) if (!PyArg_Parse(v, "es", "ascii", &cStr)) return 0; *p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, kCFStringEncodingASCII); + PyMem_Free(cStr); return 1; } if (PyUnicode_Check(v)) { diff --git a/Mac/Modules/cf/cfsupport.py b/Mac/Modules/cf/cfsupport.py index 23c8598..a1913c3 100644 --- a/Mac/Modules/cf/cfsupport.py +++ b/Mac/Modules/cf/cfsupport.py @@ -429,6 +429,7 @@ class CFStringRefObjectDefinition(MyGlobalObjectDefinition): if (!PyArg_Parse(v, "es", "ascii", &cStr)) return NULL; *p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, kCFStringEncodingASCII); + PyMem_Free(cStr); return 1; } if (PyUnicode_Check(v)) { diff --git a/Mac/Modules/cf/pycfbridge.c b/Mac/Modules/cf/pycfbridge.c index ae9e128..06700b3 100644 --- a/Mac/Modules/cf/pycfbridge.c +++ b/Mac/Modules/cf/pycfbridge.c @@ -285,6 +285,7 @@ PyCF_Python2CF_string(PyObject *src, CFStringRef *dst) { if (!PyArg_Parse(src, "es", "ascii", &chars)) return 0; /* This error is more descriptive than the general one below */ *dst = CFStringCreateWithCString((CFAllocatorRef)NULL, chars, kCFStringEncodingASCII); + PyMem_Free(chars); return 1; } if (PyUnicode_Check(src)) { |