mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
Free additional variables
Co-authored-by: Ondrej Baranovič <3819630+nulano@users.noreply.github.com>
This commit is contained in:
parent
dc79a09d62
commit
0ea1184bcf
|
@ -1250,6 +1250,7 @@ _histogram(ImagingObject *self, PyObject *args) {
|
|||
/* Build an integer list containing the histogram */
|
||||
list = PyList_New(h->bands * 256);
|
||||
if (list == NULL) {
|
||||
ImagingHistogramDelete(h);
|
||||
return NULL;
|
||||
}
|
||||
for (i = 0; i < h->bands * 256; i++) {
|
||||
|
@ -2158,6 +2159,7 @@ _getcolors(ImagingObject *self, PyObject *args) {
|
|||
} else {
|
||||
out = PyList_New(colors);
|
||||
if (out == NULL) {
|
||||
free(items);
|
||||
return NULL;
|
||||
}
|
||||
for (i = 0; i < colors; i++) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user