wireguard: fix potential leaks of async frame 53/38353/2
authorGabriel Oginski <gabrielx.oginski@intel.com>
Fri, 24 Feb 2023 10:22:32 +0000 (10:22 +0000)
committerFan Zhang <fanzhang.oss@gmail.com>
Mon, 27 Feb 2023 13:33:21 +0000 (13:33 +0000)
commita10437fcccc58626d00aa3814ccf18313a5b1a17
tree44f78c5764bd437aee7b2a09b11395c7a147f7b2
parent5035bf04130a35b76f6b49f450e27d02bafb9dab
wireguard: fix potential leaks of async frame

The current implementation can cause memory leaks of async frames
and exhaust the async frames pool. Wireguard can early get async frame,
even when later it turns out it is not needed. Then such frame won't
be freed.

This fix changes the moment of acquiring async frame from the pool, so
it doesn't leak.

Type: fix
Signed-off-by: Gabriel Oginski <gabrielx.oginski@intel.com>
Change-Id: If7696de6a6f5db84e0dffef60caa31d4a5e6280e
src/plugins/wireguard/wireguard_output_tun.c