Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To assure that zero is never passed as a size argument to malloc(), a check must be made on the size, s, parameter s to assure it is not zero.

Code Block
if (s== 0) {
  /* Handle Error */
}
list = (int*)malloc(s);
if (i_list == NULL) {
  /* Handle Allocation Error */
}
/* Continue Processing list */

...