aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2023-03-08 13:28:51 +0000
committerDave Wallace <dwallacelf@gmail.com>2023-03-14 15:59:31 +0000
commitf6d3abd0d18038c872b1c91cad2631463dfe97ec (patch)
tree719c7cbaff333ff0c133fc23600daf3245e5cc3f /src/vnet
parenta361a3951c5cc825fcb4e94c41255e2074261769 (diff)
memif: don't leak error strings in API handlers
Type: fix Fixes: ab4d917 Change-Id: I226044f64e1577033798fd203a2e981c894830d6 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/api_errno.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/api_errno.h b/src/vnet/api_errno.h
index 60e48f4a779..52f201c081b 100644
--- a/src/vnet/api_errno.h
+++ b/src/vnet/api_errno.h
@@ -42,6 +42,14 @@ vnet_api_error (clib_error_t *err)
return err->code;
}
+static_always_inline vnet_api_error_t
+vnet_get_api_error_and_free (clib_error_t *err)
+{
+ vnet_api_error_t rv = vnet_api_error (err);
+ clib_error_free (err);
+ return rv;
+}
+
#endif /* included_vnet_api_errno_h */
/*