Suppose this is a part of my code:
int foo() { char *p, *q ; if((p = malloc(BUFSIZ)) == NULL) { return ERROR_CODE; } if((q = malloc(B
it is matter of habit, but I prefer:
int returnFlag = FAILURE; if ((p = malloc...) != NULL) { if ((q = malloc..) != NULL) { // do some work returnFlag = SUCCESS; // success only if it is actually success free(q); } free(p); } return returnFlag; // all other variants are failure