Fix memory leak in trace_sched.
Use valgrind tool (http://valgrind.org/) to check the memory leak problem. Now the valgrind can be compiled on the following platforms: X86/Linux, AMD64/Linux, PPC32/Linux, PPC64/Linux.
=================
Before patching
=================
# valgrind --leak-check=full --show-reachable=yes ./trace_sched -c 1
....................
==17984== LEAK SUMMARY:
==17984==    definitely lost: 3,980 bytes in 199 blocks.
==17984==      possibly lost: 0 bytes in 0 blocks.
==17984==    still reachable: 984 bytes in 6 blocks.
==17984==         suppressed: 0 bytes in 0 blocks.
=================
After patching
=================
# valgrind --leak-check=full --show-reachable=yes ./trace_sched -c 1
.....................
==29570== LEAK SUMMARY:
==29570==    definitely lost: 0 bytes in 0 blocks.
==29570==      possibly lost: 0 bytes in 0 blocks.
==29570==    still reachable: 964 bytes in 5 blocks.
==29570==         suppressed: 0 bytes in 0 blocks.
Signed-off-by: Jin Bing Guo <guojb@cn.ibm.com>
1 file changed