title: How to free memory created by malloc after using execvp?
body: <p>In my C program, I create a child process and in it, it parses a string and created a pointer array (using <code>malloc()</code>) for the use of passing it in <code>execvp()</code> command. </p>
  
  <p>But the problem is, how do you free the memory that the child created? <code>execvp()</code> runs the new task and may or may not return. If it doesn't return, then it was successful and the child dies (and I can't really use the <code>free()</code> command). If it failed then it returned, then it continues doing the next lines of code, is this the only chance to free the memory? </p>