Skip to content

Possible memory leak #8412

@VoroninArtemii

Description

@VoroninArtemii

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions