Macs don't have malloc.h, hopefully this fixes the build. (cherry picked from commit 6cc5076a) Change-Id: I94d10d2c3d16893625df210bdd5587eea4a1247f