diff --git a/swad_changelog.h b/swad_changelog.h index 9bd5a344..72377aed 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -138,13 +138,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.168 (2016-03-29)" +#define Log_PLATFORM_VERSION "SWAD 15.168.1 (2016-03-30)" #define CSS_FILE "swad15.165.5.css" #define JS_FILE "swad15.131.3.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 15.168.1: Mar 30, 2016 Fixed bug in list o parameters. (197097 lines) Version 15.168: Mar 30, 2016 When content is normal, all parameters are retrieved in a list. (197085 lines) Version 15.167: Mar 30, 2016 Query string is allocated to the exact needed size to optimize memory. (196998 lines) Version 15.166.1: Mar 30, 2016 Fixed bug while reading a parameter. (196959 lines) diff --git a/swad_global.c b/swad_global.c index ac44a73d..b129849f 100644 --- a/swad_global.c +++ b/swad_global.c @@ -473,5 +473,5 @@ void Gbl_Cleanup (void) if (Gbl.F.Tmp) fclose (Gbl.F.Tmp); Fil_CloseXMLFile (); - Par_FreeQueryString (); + Par_FreeParams (); } diff --git a/swad_parameter.c b/swad_parameter.c index af5b0ef7..d1492424 100644 --- a/swad_parameter.c +++ b/swad_parameter.c @@ -157,8 +157,21 @@ bool Par_GetQueryString (void) /***************** Free memory allocated for query string ********************/ /*****************************************************************************/ -void Par_FreeQueryString (void) +void Par_FreeParams (void) { + struct Param *Param; + struct Param *NextParam; + + /***** Free list of parameters *****/ + for (Param = Gbl.Params.List; + Param != NULL; + Param = NextParam) + { + NextParam = Param->Next; + free ((void *) Param); + } + + /***** Free query string *****/ if (Gbl.Params.QueryString) free ((void *) Gbl.Params.QueryString); } diff --git a/swad_parameter.h b/swad_parameter.h index 2969b19a..ea43b7d1 100644 --- a/swad_parameter.h +++ b/swad_parameter.h @@ -59,7 +59,7 @@ typedef enum /*****************************************************************************/ bool Par_GetQueryString (void); -void Par_FreeQueryString (void); +void Par_FreeParams (void); void Par_GetMainParameters (void); unsigned Par_GetParToText (const char *ParamName,char *ParamValue,size_t MaxBytes);