malloc needs to use sizeof(t)