Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
a81bcf3
)
ikev2: fix memory leak
18/30018/2
author
Filip Tehlar
<ftehlar@cisco.com>
Fri, 30 Oct 2020 05:00:18 +0000
(
05:00
+0000)
committer
Andrew Yourtchenko
<ayourtch@gmail.com>
Thu, 26 Nov 2020 15:02:41 +0000
(15:02 +0000)
Type: fix
Change-Id: I33c38c791cc9a28898de402ae831c4862073eb2d
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
(cherry picked from commit
b8bc2f1ef3332a795880f11f1c45a77b1b7851f6
)
src/plugins/ikev2/ikev2.c
patch
|
blob
|
history
diff --git
a/src/plugins/ikev2/ikev2.c
b/src/plugins/ikev2/ikev2.c
index
025b34c
..
2281c91
100644
(file)
--- a/
src/plugins/ikev2/ikev2.c
+++ b/
src/plugins/ikev2/ikev2.c
@@
-1443,17
+1443,22
@@
ikev2_process_create_child_sa_req (vlib_main_t * vm,
rekey->tsi = tsi;
rekey->tsr = tsr;
/* update Ni */
- vec_
free
(sa->i_nonce);
+ vec_
reset_length
(sa->i_nonce);
vec_add (sa->i_nonce, nonce, IKEV2_NONCE_SIZE);
/* generate new Nr */
vec_validate (sa->r_nonce, IKEV2_NONCE_SIZE - 1);
RAND_bytes ((u8 *) sa->r_nonce, IKEV2_NONCE_SIZE);
- vec_free (n);
}
+ else
+ goto cleanup_and_exit;
+ vec_free (n);
return 1;
cleanup_and_exit:
vec_free (n);
+ vec_free (proposal);
+ vec_free (tsr);
+ vec_free (tsi);
return 0;
}