aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/udp
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-07-18 18:38:42 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-11 11:46:42 +0000
commit4adcdcd197a99c1adb0761ed9acedb3cfd1e37fb (patch)
treebd128b6463483dc0e8843c3ed19256cdaed31eab /src/vnet/udp
parent88af6c3f4a22d12674e7c598d0c77d0254cf0f47 (diff)
session: fix use-after-free
Make sure to reinitialize data before free-ing it. Type: fix Change-Id: I45727c456d0345204d4825ecdd9690c5ebeb5e94 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit d4aeb84c3f066b755b723163da292eab95bd1ef9)
Diffstat (limited to 'src/vnet/udp')
-rw-r--r--src/vnet/udp/udp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vnet/udp/udp.c b/src/vnet/udp/udp.c
index 949c6356d33..fbd9e980181 100644
--- a/src/vnet/udp/udp.c
+++ b/src/vnet/udp/udp.c
@@ -58,9 +58,10 @@ udp_connection_alloc (u32 thread_index)
void
udp_connection_free (udp_connection_t * uc)
{
- pool_put (udp_main.connections[uc->c_thread_index], uc);
+ u32 thread_index = uc->c_thread_index;
if (CLIB_DEBUG)
clib_memset (uc, 0xFA, sizeof (*uc));
+ pool_put (udp_main.connections[thread_index], uc);
}
void