From 194b0bc9f0a4699854ea314ffa23e59f8082ddae Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 8 May 2021 17:14:46 +0200 Subject: Remove some memory-leaks --- src/sp_config.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/sp_config.c') diff --git a/src/sp_config.c b/src/sp_config.c index 69730e3..958c7e5 100644 --- a/src/sp_config.c +++ b/src/sp_config.c @@ -216,11 +216,32 @@ void sp_disabled_function_list_free(sp_list_node *list) { sp_list_node *cursor = list; while (cursor) { sp_disabled_function *df = cursor->data; - if (df && df->functions_list) sp_list_free(df->functions_list); if (df) { + sp_list_free(df->functions_list); + sp_list_free(df->param_array_keys); + sp_list_free(df->var_array_keys); + + sp_pcre_free(df->r_filename); + sp_pcre_free(df->r_function); + sp_pcre_free(df->r_param); + sp_pcre_free(df->r_ret); + sp_pcre_free(df->r_value); + sp_pcre_free(df->r_key); + sp_tree_free(df->param); sp_tree_free(df->var); } cursor = cursor->next; } } + +void sp_cookie_list_free(sp_list_node *list) { + sp_list_node *cursor = list; + while (cursor) { + sp_cookie *c = cursor->data; + if (c) { + sp_pcre_free(c->name_r); + } + cursor = cursor->next; + } +} -- cgit v1.3