No.
This is not a memory leak. exec*() will create a local copy of the string data in the args array, then blow off the memory image of the child process and overlay it on the memory image used by /bin/echo . Essentially, all that remains after exec () is pid.
Edit:
User 318904 examined the case of exec () returning -1 (i.e. failure). In this case, the child process that unlocked but did not execute exec does technically have a memory leak, but since the usual response to the failed exec is just the exit from the child process, the memory will be recovered by the OS. However, liberation is probably a good habit to join, if only for the reason that it will not let you not think about it later.
source share