Skip to content

SAST Potential resource leaks #5008

@arinochk

Description

@arinochk

The static analyzer has identified several instances of potential resource leaks.

In notify_socket.go L180, a bidirectional read-write pipe is opened. If the function exits at line 188, this pipe is not closed.

Image

In libcontainer/init_linux.go L192, a file descriptor fifoFile is opened. The function returns at line 199 without closing the allocated resource.

Image

In libcontainer/process_linux.go L74, when the NewSockPair function is called, it creates file descriptors which are stored in comm.initSockParent and comm.initSockChild. If the function returns early at lines 80 or 84, these file descriptors are not closed, as the function returns nil. The same applies to comm.syncSockParent and comm.syncSockChild created at line 78.

Image

In mount_linux.go#L287, a file descriptor mountFile is created. The function then returns at lines 298, 303, and 325 without closing the allocated resources.

Image

Could you please confirm if these are indeed genuine resource leaks?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions