NetworkPkg: Check allocated buffer pointer before use.