gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: -fix memory leaks


From: gnunet
Subject: [gnunet] branch master updated: -fix memory leaks
Date: Tue, 03 Aug 2021 14:36:13 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 9fecb9ed0 -fix memory leaks
9fecb9ed0 is described below

commit 9fecb9ed0ea6ae70d636412dead00e56cb3f474c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Aug 3 14:32:48 2021 +0200

    -fix memory leaks
---
 src/util/configuration.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/util/configuration.c b/src/util/configuration.c
index 93bc03189..dff3c2e99 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -322,7 +322,9 @@ GNUNET_CONFIGURATION_destroy (struct 
GNUNET_CONFIGURATION_Handle *cfg)
     GNUNET_CONTAINER_DLL_remove (cfg->loaded_files_head,
                                  cfg->loaded_files_tail,
                                  cf);
+    GNUNET_free (cf);
   }
+  GNUNET_free (cfg->main_filename);
   GNUNET_free (cfg);
 }
 
@@ -336,7 +338,9 @@ GNUNET_CONFIGURATION_parse_and_run (const char *filename,
   enum GNUNET_GenericReturnValue ret;
 
   cfg = GNUNET_CONFIGURATION_create ();
-  if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, filename))
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_load (cfg,
+                                 filename))
   {
     GNUNET_break (0);
     GNUNET_CONFIGURATION_destroy (cfg);
@@ -620,7 +624,7 @@ handle_inline (struct GNUNET_CONFIGURATION_Handle *cfg,
   {
     fun_ret = GNUNET_OK;
   }
- cleanup:
+cleanup:
   cfg->current_nest_level = old_nest_level;
   if (NULL != other_cfg)
     GNUNET_CONFIGURATION_destroy (other_cfg);
@@ -2314,7 +2318,7 @@ GNUNET_CONFIGURATION_load_from (struct 
GNUNET_CONFIGURATION_Handle *cfg,
     if (fun_ret != GNUNET_OK)
       break;
   }
- cleanup:
+cleanup:
   if (files_context.files_length > 0)
   {
     for (size_t i = 0; i < files_context.files_length; i++)
@@ -2467,7 +2471,10 @@ GNUNET_CONFIGURATION_load (struct 
GNUNET_CONFIGURATION_Handle *cfg,
   }
   cfg->load_called = true;
   if (NULL != filename)
+  {
+    GNUNET_free (cfg->main_filename);
     cfg->main_filename = GNUNET_strdup (filename);
+  }
 
   base_config_varname = GNUNET_OS_project_data_get ()->base_config_varname;
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]