summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/vec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/vec.c')
-rw-r--r--src/vppinfra/vec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vppinfra/vec.c b/src/vppinfra/vec.c
index 2d7ae1d4dc6..a0b3e038af1 100644
--- a/src/vppinfra/vec.c
+++ b/src/vppinfra/vec.c
@@ -94,10 +94,10 @@ vec_resize_allocate_memory (void *v,
clib_memcpy (new, old, old_alloc_bytes);
clib_mem_free (old);
- v = new;
/* Allocator may give a bit of extra room. */
- new_alloc_bytes = clib_mem_size (v);
+ new_alloc_bytes = clib_mem_size (new);
+ v = new;
/* Zero new memory. */
memset (v + old_alloc_bytes, 0, new_alloc_bytes - old_alloc_bytes);