Skip to content

[Defect] Memory leak in memcached.c:7757 #338

@gangfan

Description

@gangfan

Our tool Pinpoint has found a memory leak defect in memcachd.c. The screenshots illustrate the detailed program steps that can trigger this memory leak defect.

Description:
The memory allocated on line 7676 is stored to pointer temp_portnumber_filename. If the fopen call fails on line 7681, which makes the pointer portnumber_file to be nullptr. In this case, the free call on line 7713 will be skipped and the memory leaked.

image
image
image
image

Gang
Sourcebrella & HKUST

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions