strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed the longstanding myids memory leak
[strongswan.git]
/
src
/
pluto
/
id.c
diff --git
a/src/pluto/id.c
b/src/pluto/id.c
index
6c27baa
..
5bbf531
100644
(file)
--- a/
src/pluto/id.c
+++ b/
src/pluto/id.c
@@
-66,6
+66,21
@@
init_id(void)
set_myFQDN();
}
set_myFQDN();
}
+/*
+ * free id module
+ */
+void
+free_id(void)
+{
+ enum myid_state s;
+
+ for (s = MYID_UNKNOWN; s <= MYID_SPECIFIED; s++)
+ {
+ free_id_content(&myids[s]);
+ free(myid_str[s]);
+ }
+}
+
static void
calc_myid_str(enum myid_state s)
{
static void
calc_myid_str(enum myid_state s)
{
@@
-423,7
+438,7
@@
same_id(const struct id *a, const struct id *b)
case ID_KEY_ID:
return a->name.len == b->name.len
case ID_KEY_ID:
return a->name.len == b->name.len
- && mem
cmp(a->name.ptr, b->name.ptr, a->name.len) == 0
;
+ && mem
eq(a->name.ptr, b->name.ptr, a->name.len)
;
default:
bad_case(a->kind);
default:
bad_case(a->kind);