Malloc/free issues

I don't know much about GIGA or embed, but most MCUs allocate based on the memory alignment boundary.

In this code, c1 is likely to be NULL, so I think you should check it as follows.

  c1 = (unsigned char*)SDRAM.malloc(1);
  if (c1 == NULL) {
    // some error trapping code
  }
1 Like