summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2021-10-11 15:08:25 +0000
committerFilip Tehlar <ftehlar@cisco.com>2021-10-11 15:08:25 +0000
commit1fa06c9a0642ebd0d2a7dcaa5359ac47be8f4ffa (patch)
tree4b5624b990993d93d6988928eb5b1f58316aeda1 /src
parent6958c23bd54f38599de63854330020b46cbd24a9 (diff)
vat: move memset after init
Type: fix Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: Ia65fd2f99dfe6538411c247aeb9691c590c2e00b
Diffstat (limited to 'src')
-rw-r--r--src/vat/plugin.c2
-rw-r--r--src/vpp/api/plugin.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/vat/plugin.c b/src/vat/plugin.c
index 5c7045415a8..09a96fd2ca4 100644
--- a/src/vat/plugin.c
+++ b/src/vat/plugin.c
@@ -148,6 +148,7 @@ vat_load_new_plugins (plugin_main_t * pm)
if (p == 0)
{
vec_add2 (pm->plugin_info, pi, 1);
+ clib_memset (pi, 0, sizeof (*pi));
pi->name = plugin_name;
pi->file_info = statb;
@@ -157,7 +158,6 @@ vat_load_new_plugins (plugin_main_t * pm)
_vec_len (pm->plugin_info) = vec_len (pm->plugin_info) - 1;
continue;
}
- clib_memset (pi, 0, sizeof (*pi));
hash_set_mem (pm->plugin_by_name_hash, plugin_name,
pi - pm->plugin_info);
}
diff --git a/src/vpp/api/plugin.c b/src/vpp/api/plugin.c
index 410d497a0aa..3d89161cb86 100644
--- a/src/vpp/api/plugin.c
+++ b/src/vpp/api/plugin.c
@@ -161,6 +161,7 @@ vat_load_new_plugins (plugin_main_t * pm)
if (p == 0)
{
vec_add2 (pm->plugin_info, pi, 1);
+ clib_memset (pi, 0, sizeof (*pi));
pi->name = plugin_name;
pi->filename = file_name;
pi->file_info = statb;
@@ -172,7 +173,6 @@ vat_load_new_plugins (plugin_main_t * pm)
_vec_len (pm->plugin_info) = vec_len (pm->plugin_info) - 1;
continue;
}
- clib_memset (pi, 0, sizeof (*pi));
hash_set_mem (pm->plugin_by_name_hash, plugin_name,
pi - pm->plugin_info);
}