阅读背景:

在C程序中肯定丢失了内存泄漏。

来源:互联网 

Would someone be able to shed light on why Valgrind classifies this program as a "Definitely Lost: 2 bytes in 1 block" memory leak? I understand that the commented line resolves the issue, but I don't understand the classification. According to Valgrind docs it appears that the memory leak should be classified as "Indirectly Reachable". I am also curious as to why this is even considered a memory leak and would appreciate an explanation. Is it good practice to manually free everything even though the program is terminating at the end of the Would someone be able to shed light on why Valg




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: