mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-30 09:53:39 +03:00
Call FT_Done_MM_Var when returning early
Co-authored-by: Ondrej Baranovič <3819630+nulano@users.noreply.github.com>
This commit is contained in:
parent
7632d8df36
commit
448ab0a687
|
@ -1083,6 +1083,7 @@ font_getvarnames(FontObject *self) {
|
||||||
num_namedstyles = master->num_namedstyles;
|
num_namedstyles = master->num_namedstyles;
|
||||||
list_names = PyList_New(num_namedstyles);
|
list_names = PyList_New(num_namedstyles);
|
||||||
if (list_names == NULL) {
|
if (list_names == NULL) {
|
||||||
|
FT_Done_MM_Var(library, master);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1091,6 +1092,7 @@ font_getvarnames(FontObject *self) {
|
||||||
error = FT_Get_Sfnt_Name(self->face, i, &name);
|
error = FT_Get_Sfnt_Name(self->face, i, &name);
|
||||||
if (error) {
|
if (error) {
|
||||||
Py_DECREF(list_names);
|
Py_DECREF(list_names);
|
||||||
|
FT_Done_MM_Var(library, master);
|
||||||
return geterror(error);
|
return geterror(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1130,6 +1132,7 @@ font_getvaraxes(FontObject *self) {
|
||||||
|
|
||||||
list_axes = PyList_New(num_axis);
|
list_axes = PyList_New(num_axis);
|
||||||
if (list_axes == NULL) {
|
if (list_axes == NULL) {
|
||||||
|
FT_Done_MM_Var(library, master);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_axis; i++) {
|
for (i = 0; i < num_axis; i++) {
|
||||||
|
@ -1138,6 +1141,7 @@ font_getvaraxes(FontObject *self) {
|
||||||
list_axis = PyDict_New();
|
list_axis = PyDict_New();
|
||||||
if (list_axis == NULL) {
|
if (list_axis == NULL) {
|
||||||
Py_DECREF(list_axes);
|
Py_DECREF(list_axes);
|
||||||
|
FT_Done_MM_Var(library, master);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
PyObject *minimum = PyLong_FromLong(axis.minimum / 65536);
|
PyObject *minimum = PyLong_FromLong(axis.minimum / 65536);
|
||||||
|
@ -1157,6 +1161,7 @@ font_getvaraxes(FontObject *self) {
|
||||||
if (error) {
|
if (error) {
|
||||||
Py_DECREF(list_axis);
|
Py_DECREF(list_axis);
|
||||||
Py_DECREF(list_axes);
|
Py_DECREF(list_axes);
|
||||||
|
FT_Done_MM_Var(library, master);
|
||||||
return geterror(error);
|
return geterror(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user