Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible memory leak #8412

Open
VoroninArtemii opened this issue Sep 24, 2024 · 1 comment · May be fixed by #8413
Open

Possible memory leak #8412

VoroninArtemii opened this issue Sep 24, 2024 · 1 comment · May be fixed by #8413
Labels

Comments

@VoroninArtemii
Copy link

There is a possible memory leak:

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.

@radarhere radarhere linked a pull request Sep 24, 2024 that will close this issue
@radarhere
Copy link
Member

I've created #8413 to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants