Mercurial > hg > waaad
changeset 124:b4d229d647b7
Cleanup properly in termination
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Fri, 08 Aug 2008 18:16:36 +0900 |
parents | d1cef88ac5f2 |
children | 8aa829378790 |
files | waaad/conf.c |
diffstat | 1 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/waaad/conf.c Fri Aug 08 18:04:38 2008 +0900 +++ b/waaad/conf.c Fri Aug 08 18:16:36 2008 +0900 @@ -187,7 +187,8 @@ TRACE_DEBUG (INFO, "Error occurred, message logged -- configuration file."); return ret; } - + + /* call yacc parser */ ret = yyparse(g_conf); fclose(yyin); @@ -197,7 +198,7 @@ return EINVAL; } - /* We now resolv the diameter-id */ + /* resolve the diameter-id, store result in local_addr_diamid */ { struct addrinfo *ai = NULL, *p, hints; int gotip4 = 0; @@ -233,6 +234,8 @@ freeaddrinfo(ai); } + + /* Dump the config and exit */ conf_dump(); return 0; @@ -241,6 +244,14 @@ /* Terminate the configuration module. */ int conf_fini ( void ) { - /* Nothing to do yet */ + if (g_pconf->diameter_identity) + free(g_pconf->diameter_identity); + + if (g_pconf->local_addr_pri_sa) + free(g_pconf->local_addr_pri_sa); + + if (g_pconf->local_addr_sec_sa) + free(g_pconf->local_addr_sec_sa); + return 0; }