Comment: Re:I miss GOTO...there I said it (Score 3, Informative) 353
GOTO is certainly very useful in some circumstances. For example, a common pattern in the samba and SSSD sources is this (taking advantage of the talloc() hierarchical memory allocator):
tmp_ctx = talloc_new(parent_ctx).
*allocate memory on tmp_ctx *
do stuff or fail and goto done.
*allocate more memory on tmp_ctx *
do stuff or fail and goto done.
done:
talloc_free(tmp_ctx);
return result;
It's really handy to be able to just jump directly to the done: tag on any error and know that any memory you allocated is cleaned up appropriately.