Free additional variables

Co-authored-by: Ondrej Baranovič <3819630+nulano@users.noreply.github.com>
This commit is contained in:
Andrew Murray 2023-03-30 07:54:01 +11:00 committed by GitHub
parent dc79a09d62
commit 0ea1184bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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++) {