improve allocation for UDP
improve allocation for UDP (fix compilation)