c - warning for not using free() malloc -



c - warning for not using free() malloc -

are there safeguards built gcc check memory leaks? if how can utilize them? when compile "gcc -wall -o run run.c", compiler not seem care if allocated heap-space beingness freed @ end of code. not find simple fixes on google.

thanks much time.

edit: google searches did point valgrind among other tools. curious why compiler cant deal issue. newbie, seemed simple plenty task check if every "malloc" has "free" associated it.

there 2 ways analyze code problems - static analysis , run-time analysis. static analysis reads code - compilers well. run-time analysis code problems happens when code linked against set of libraries see code runs under surveillance. finding memory leaks hard static analysis not run-time analysis package.

other run-time analyses things code coverage - parts of code run? gcov this, valgrind , electrical fence memory problems leaks.

so, no, there no compiler safeguards testing memory leaks.

c

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -