If the shell creates a child process, but doesn't wait for it (doesn't immediately call waitpid), it should call waitpid to reap the process when it terminates.
How will the shell know when the child terminates in this case? The parent process (the shell) will receive a SIGCHLD signal when the child terminates.
The shell needs to write a signal handler for the SIGCHLD signal and can call waitpid in that handler to reap the child process.
Note: The default handler for SIGCHLD is to just ignore it.