title: memory leak! how to fix?
body: <p>Ok, so i'm just learning about memory leaks. i ran valgrind to find memory leaks. i get the following:</p>
  
  <pre><code>==6134== 24 bytes in 3 blocks are definitely lost in loss record 4 of 4
  ==6134==    at 0x4026351: operator new(unsigned int) (vg_replace_malloc.c:255)
  ==6134==    by 0x8048B74: readInput(char&amp;) (in calc)
  </code></pre>
  
  <p>so does that definitively mean the leak is in my readInput function? if so, how do i get rid of the memory leaks? here's the offending function:</p>
  
  <pre><code>double* readInput(char&amp; command){
      std::string in;
      std::getline(std::cin, in);
  
      if(!isNumber(in)){
          if(in.length()&gt;1){
              command = 0;
          }
          else{
              command = in.c_str()[0];
          }
          return NULL;
      }
      else{
          return new double(atof(in.c_str()));
      }
  }
  </code></pre>
  
  <p>thanks!</p>