summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-09-11 16:43:44 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-07 13:10:10 +0000
commitc8f447e71ea0da7d3902900f1fd0ab9b68a44b58 (patch)
tree5f165eafb30d6a3a819fb5ad2512267dabcf4bdc
parent8f4fccab9f7614f63dbae6aafd332c5beb71dba4 (diff)
api: fix use-after-free
Type: fix Change-Id: I2a599c22d5770587fdd419e5d212c8527054d2e9 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit f26b2511cf661d4ebef32c19f944041637ec5907)
-rw-r--r--src/vlibmemory/memory_api.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vlibmemory/memory_api.c b/src/vlibmemory/memory_api.c
index b87aa76b2d0..34fd9563b73 100644
--- a/src/vlibmemory/memory_api.c
+++ b/src/vlibmemory/memory_api.c
@@ -319,6 +319,9 @@ vl_api_memclnt_delete_t_handler (vl_api_memclnt_delete_t * mp)
}
}
+ /* No dangling references, please */
+ *regpp = 0;
+
/* For horizontal scaling, add a hash table... */
for (i = 0; i < vec_len (am->vlib_private_rps); i++)
{
@@ -347,9 +350,6 @@ vl_api_memclnt_delete_t_handler (vl_api_memclnt_delete_t * mp)
}
}
- /* No dangling references, please */
- *regpp = 0;
-
if (private_registration == 0)
{
pool_put_index (am->vl_clients,