Yeah but you would only hit that if you ran multiple system() calls simultaneously via multithreading, not sequentially in a loop like
for (i=0; i<1000; i++)
Locks and allocated memory are freed when the process exits, so this is a leak:
only until this point:
Memory leaks and locked resources are only an issue when processes insist on not exiting.