Return NULL if dh struct cannot be allocated completely