Should probably use aim_malloc to get the NULL check.