* will be ahead of time...
*/
for (i = 1024; ; i += i) {
- outbuf = (char *)malloc(i);
+ outbuf = (char *)PyMem_Malloc(i);
if (outbuf == NULL) {
return PyErr_NoMemory();
}
e.g. an empty format, or %Z when the timezone
is unknown. */
PyObject *ret;
- ret = PyString_FromStringAndSize(outbuf, buflen);
- free(outbuf);
+ ret = PyUnicode_FromStringAndSize(outbuf, buflen);
+ PyMem_Free(outbuf);
return ret;
}
- free(outbuf);
+ PyMem_Free(outbuf);
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
/* VisualStudio .NET 2005 does this properly */
if (buflen == 0 && errno == EINVAL) {
return 0;
}
#endif
-
}
}