Patrick Steinhardt <ps@xxxxxx> writes: > It's needed in the sense that your version leaks memory -- the `ti` > pointer is never free'd. Other than that they are equivalent indeed. Ah, OK, I somehow misread that _close() will free the resource, but it only frees the resources held by the shell and not the shell itself. Thanks.