set packet size only once all necessary memory has been reserved

If problem were occuring in the last memory reservation, you could end
up corrupting unread packets.