...
Code Block | ||||
---|---|---|---|---|
| ||||
char *p = /* Initialize; may or may not be NULL */ if (p || (p = (char *) malloc(BUF_SIZE)) ) { /* Do stuff withPerform some computation based on p */ free(p); p = NULL; } else { /* Handle malloc() error */ return; } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
char *p; char *q = NULL; if (p == NULL) { q = (char *) malloc(BUF_SIZE); p = q; } if (p == NULL) { /* Handle malloc() error */ return; } /* Perform Dosome computation stuffbased withon p */ free(q); q = NULL; |
Risk Assessment
...