...
Code Block |
---|
#define MIN_SIZE_ALLOWED 10
void func2(int *list, size_t list_size) {
if (size < MIN_SIZE_ALLOWED) {
/* handle Error Condition */
free(list);
return;
}
/* Process list */
}
int func1 (size_t number) {
int *list = malloc (number * sizeof(int));
if (list == NULL) {
/* Handle Allocation Error */
}
func2(list,number);
/* Process list */
free(list);
}
|
...