fix for #2783, Return none without error set

This commit is contained in:
Eric Soroos 2017-10-04 10:56:20 +00:00
parent 5e159c2ff4
commit 87abdf5e6d

View File

@ -2212,7 +2212,6 @@ void _font_text_asBytes(PyObject* encoded_string, unsigned char** text){
PyBytes_AsStringAndSize(encoded_string, &buffer, &len); PyBytes_AsStringAndSize(encoded_string, &buffer, &len);
} }
if (len) {
*text = calloc(len,1); *text = calloc(len,1);
if (*text) { if (*text) {
memcpy(*text, buffer, len); memcpy(*text, buffer, len);
@ -2220,8 +2219,8 @@ void _font_text_asBytes(PyObject* encoded_string, unsigned char** text){
if(bytes) { if(bytes) {
Py_DECREF(bytes); Py_DECREF(bytes);
} }
return; return;
}
#if PY_VERSION_HEX < 0x03000000 #if PY_VERSION_HEX < 0x03000000