Skip to content

Commit

Permalink
Free memory on early return
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Sep 24, 2024
1 parent 8d0a6d0 commit 0105f5a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libImaging/SgiRleDecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t
}
_imaging_seek_pyFd(state->fd, SGI_HEADER_SIZE, SEEK_SET);
if (_imaging_read_pyFd(state->fd, (char *)ptr, c->bufsize) != c->bufsize) {
free(ptr);
state->errcode = IMAGING_CODEC_UNKNOWN;
return -1;
}
Expand Down

0 comments on commit 0105f5a

Please sign in to comment.