fixed malloc check

This commit is contained in:
wiredfool 2017-07-18 02:58:24 -07:00 committed by Eric Soroos
parent fd0e7be55a
commit 539c5fdb5f

View File

@ -2215,7 +2215,7 @@ void _font_text_asBytes(PyObject* encoded_string, unsigned char** text){
if (len) {
*text = calloc(len,1);
if (text) {
if (*text) {
memcpy(*text, buffer, len);
}
if(bytes) {
@ -2231,7 +2231,7 @@ void _font_text_asBytes(PyObject* encoded_string, unsigned char** text){
if (PyString_Check(encoded_string)) {
PyString_AsStringAndSize(encoded_string, &buffer, &len);
*text = calloc(len,1);
if (text) {
if (*text) {
memcpy(*text, buffer, len);
}
return;