mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
fixed malloc check
This commit is contained in:
parent
fd0e7be55a
commit
539c5fdb5f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user