aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluoyaozu <luoyaozu@foxmail.com>2022-10-31 21:46:38 +0800
committerMatthew Smith <mgsmith@netgate.com>2022-11-10 18:48:09 +0000
commit37b5cccb93a5caaba252719630b95e80113df551 (patch)
treeffaa9e7df47426f3a0a614a244ee472050a35566
parentb15a0000fff121cdd9ab03c208da429e27901b38 (diff)
linux-cp: fix lcp_itf_pair_create()'s memory leak
need free args.error if args.rv < 0 Type: fix Signed-off-by: luoyaozu <luoyaozu@foxmail.com> Change-Id: I8ceebfc36f51798d8d1a8e4c41bec33d74344396
-rw-r--r--src/plugins/linux-cp/lcp_interface.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/linux-cp/lcp_interface.c b/src/plugins/linux-cp/lcp_interface.c
index d629a0686cf..eef06ecfa19 100644
--- a/src/plugins/linux-cp/lcp_interface.c
+++ b/src/plugins/linux-cp/lcp_interface.c
@@ -979,6 +979,8 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name,
.tx_ring_sz = 256,
.host_if_name = host_if_name,
.host_namespace = 0,
+ .rv = 0,
+ .error = NULL,
};
ethernet_interface_t *ei;
u32 host_sw_mtu_size;
@@ -1017,6 +1019,7 @@ lcp_itf_pair_create (u32 phy_sw_if_index, u8 *host_if_name,
{
LCP_ITF_PAIR_ERR ("pair_create: could not create tap, retval:%d",
args.rv);
+ clib_error_free (args.error);
return args.rv;
}