我查看了那根音量指针是否在摆动。
I checked to see if the needle indicating volume was oscillating.
在main中,当从foo返回后,namestr实际上时一个摆动的指针,因为foo已经在返回前释放了那个内存。
In main, after returning from foo , namestr is actually a dangling pointer, because foo has freed that memory before returning.
列表1 .带有一个内存渗漏和一个不断摆动的指针的代码(mem_errors . c)。
Listing 1. Code with memory leak and dangling pointer (mem_errors.c).
应用推荐