gotos are sometimes used in C for error handling (to release resources), it's a simple way to do cleanup:
void foo() {
int* foo = malloc(...)
if (foo == NULL) goto err_foo;
int* bar = malloc(...)
if (bar == NULL) goto err_bar;
/* code */
err_bar:
free(bar);
err_foo:
free(foo);
}
That's a use of goto that's often considered non-evil, probably because the alternatives are typically a lot more ugly.