summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuanghua Zhang <ghzhang@fiberhome.com>2019-08-18 08:35:04 +0800
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-09-21 08:28:44 +0000
commit1348197c864f47b69d6ca99cadeaeab3fc6f19b6 (patch)
treefacc52217fd0c6e92231ada028cf14b6cf969e52 /src
parent62988dc63242b65970705c895e69aed50a6c3b47 (diff)
vlib: fix vlib_buffer_main_init_numa_node memory leak.
Type: fix Signed-off-by: Guanghua Zhang <ghzhang@fiberhome.com> Change-Id: I8252ed2555f5af6db2f12dc7c30e41cc1ec7dde0 (cherry picked from commit 785daf4f847a786ba618e3017752567f20f0be1c)
Diffstat (limited to 'src')
-rw-r--r--src/vlib/buffer.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c
index a49200d1b8f..c4c05bbbcaa 100644
--- a/src/vlib/buffer.c
+++ b/src/vlib/buffer.c
@@ -693,7 +693,7 @@ retry:
}
if (error)
- return error;
+ goto done;
vec_reset_length (name);
name = format (name, "default-numa-%d%c", numa_node, 0);
@@ -703,9 +703,14 @@ retry:
physmem_map_index);
if (*index == (u8) ~ 0)
- return clib_error_return (0, "maximum number of buffer pools reached");
+ {
+ error = clib_error_return (0, "maximum number of buffer pools reached");
+ goto done;
+ }
- return 0;
+done:
+ vec_free (name);
+ return error;
}
void