fixed the longstanding myids memory leak

This commit is contained in:
Andreas Steffen 2009-04-16 09:11:49 +00:00
parent 6319cd74ea
commit af8ab6861d
3 changed files with 18 additions and 2 deletions

View File

@ -66,6 +66,21 @@ init_id(void)
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)
{

View File

@ -27,7 +27,7 @@ struct id {
};
extern void init_id(void);
extern void free_id(void);
extern const struct id empty_id; /* ID_NONE */
enum myid_state {

View File

@ -707,6 +707,7 @@ exit_pluto(int status)
stop_adns();
free_md_pool();
free_crypto();
free_id();
delete_lock();
library_deinit();
close_log();