Source: https://cse.buffalo.edu/~eblanton/course/cse220-2019-2f/materials/08-structs-malloc.pdf