by 4dd3r · 14y ago · 0 comments
int abc(void *ctx) { int rc = -1;
if (outcome_of_first() != SUCCESS) {
my_log(MY_LEVEL, "Log my error");
goto over;
}
if (outcome_of_second() != SUCCESS) {
my_log(MY_LEVEL, "Log my error");
goto over;
}
...
rc = 0;
over:
if (something_allocated != NULL)
free(something_allocated); if (something_else_allocated != NULL)
free(something_else_allocated);
return rc;
}No comments yet.