...
Code Block | ||
---|---|---|
| ||
size_t size;
/* initialize size, possibly by user-controlled input */
int *list = (int *)malloc(size);
if (list == NULL) {
/* Handle Allocation Error */
}
/* Continue Processing list */
|
...
Code Block | ||
---|---|---|
| ||
size_t size;
/* initialize size, possibly by user-controlled input */
if (size == 0) {
/* Handle Error */
}
int *list = (int *)malloc(size);
if (list == NULL) {
/* Handle Allocation Error */
}
/* Continue Processing list */
|
...