int f(){ alloc_resources(); // operations if (error) { release_resources(); return error_code; } // operations release_resources(); return 0;}
int f(){ int status = 0; alloc_resources(); // operations if (error) { status = error_code; goto cleanup; } // operations cleanup: release_resources(); return status;}