mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-28 04:53:41 +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 */
|
/* Build an integer list containing the histogram */
|
||||||
list = PyList_New(h->bands * 256);
|
list = PyList_New(h->bands * 256);
|
||||||
if (list == NULL) {
|
if (list == NULL) {
|
||||||
|
ImagingHistogramDelete(h);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
for (i = 0; i < h->bands * 256; i++) {
|
for (i = 0; i < h->bands * 256; i++) {
|
||||||
|
@ -2158,6 +2159,7 @@ _getcolors(ImagingObject *self, PyObject *args) {
|
||||||
} else {
|
} else {
|
||||||
out = PyList_New(colors);
|
out = PyList_New(colors);
|
||||||
if (out == NULL) {
|
if (out == NULL) {
|
||||||
|
free(items);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
for (i = 0; i < colors; i++) {
|
for (i = 0; i < colors; i++) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user