ipsec: memory leak fixup
Change-Id: Ib2ad196bec1005d6678589d5b5c199b8a541c720
Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
diff --git a/src/vnet/ipsec/ipsec_sa.c b/src/vnet/ipsec/ipsec_sa.c
index b0de76a..c4721c7 100644
--- a/src/vnet/ipsec/ipsec_sa.c
+++ b/src/vnet/ipsec/ipsec_sa.c
@@ -272,7 +272,10 @@
{
err = ipsec_call_add_del_callbacks (im, sa, sa_index, 0);
if (err)
- return VNET_API_ERROR_SYSCALL_ERROR_1;
+ {
+ clib_error_free (err);
+ return VNET_API_ERROR_SYSCALL_ERROR_1;
+ }
}
return 0;