-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
There is a possible memory leak:
Pillow/src/libImaging/SgiRleDecode.c
Lines 191 to 200 in 8d0a6d0
| ptr = malloc(sizeof(UINT8) * c->bufsize); | |
| if (!ptr) { | |
| state->errcode = IMAGING_CODEC_MEMORY; | |
| return -1; | |
| } | |
| _imaging_seek_pyFd(state->fd, SGI_HEADER_SIZE, SEEK_SET); | |
| if (_imaging_read_pyFd(state->fd, (char *)ptr, c->bufsize) != c->bufsize) { | |
| state->errcode = IMAGING_CODEC_UNKNOWN; | |
| return -1; | |
| } |
We allocated memory for
ptr but didn't free it before return -1; on line 199.
Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author A. Voronin.