Skip to content

Commit 0105f5a

Browse files
committed
Free memory on early return
1 parent 8d0a6d0 commit 0105f5a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libImaging/SgiRleDecode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t
195195
}
196196
_imaging_seek_pyFd(state->fd, SGI_HEADER_SIZE, SEEK_SET);
197197
if (_imaging_read_pyFd(state->fd, (char *)ptr, c->bufsize) != c->bufsize) {
198+
free(ptr);
198199
state->errcode = IMAGING_CODEC_UNKNOWN;
199200
return -1;
200201
}

0 commit comments

Comments
 (0)