title: C - freeing memory allocated in function
body: <p>I have a function that allocates string and returns its pointer. When I use it directly in call of other function, do I need to free the memory?</p>
  
  <p>For example:</p>
  
  <pre><code>char *getRow(){
       char *someString = (char*) malloc(sizeof(char) * 10);
       strcpy(someString , "asdqwezxc");
       return someString;
  }
  
  int main(){
       printf("%s", getRow());
  }
  </code></pre>
  
  <p>What happens with memory allocated in that function? Is there any way to free it or do I need to store it to some variable before using it?</p>