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.




Gang
Sourcebrella & HKUST