...
Code Block | ||
---|---|---|
| ||
x = (int *)malloc (number * sizeof(int)); if (x == NULL) { /* Handle Allocation Error */ } /* ... */ if (error_conditoncondition == 1) { /* Handle Error Condition*/ free(x); } /* ... */ free(x); |
...
Code Block | ||
---|---|---|
| ||
if (number > SIZE_MAX/sizeof(int)) { /* handle overflow */ } x = (int *)malloc(number * sizeof(int)); if (x == NULL) { /* Handle Allocation Error */ } /* ... */ if (error_conditoncondition == 1) { /* Handle Error Condition*/ } /* ... */ free(x); |
...