diff options
-rw-r--r-- | src/vrrpv2.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vrrpv2.rs b/src/vrrpv2.rs index e0f45a6..aabe60a 100644 --- a/src/vrrpv2.rs +++ b/src/vrrpv2.rs @@ -112,7 +112,7 @@ fn parse(bytes: &[u8]) -> Result<VRRPv2, VRRPv2Error> { let Ok(checksum) = rdr.read_u16() else { return Err(VRRPv2Error::ParseError); }; - let mut ip_addrs = Vec::new(); + let mut ip_addrs = Vec::with_capacity(count_ip_addrs as usize); for _i in 0..count_ip_addrs { let Ok(b) = rdr.read_u32() else { return Err(VRRPv2Error::ParseError); |