title: valgrind error "Invalid read of size 4"
body: <p>Here is my program</p>
  
  <pre><code> int* fun1(void)
   {
      int n=9;
      int *pf=&amp;n;
      cout&lt;&lt;*pf&lt;&lt;endl;
      return pf;
   }
   int main(int argc, char *argv[])
   {
      int *p=fun1();
      cout&lt;&lt;*p;
      return 0;
   }
  </code></pre>
  
  <p>Compilation and running of program doesn't give any problems but with valgrind it gives message/warning "Invalid read of size 4".</p>
  
  <p>Any help to resolve the warning is most welcome</p>