a bug in memory allocation