aboutsummaryrefslogtreecommitdiff
path: root/src/util/gnunet-config.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-06-25 20:12:58 +0200
committerChristian Grothoff <christian@grothoff.org>2018-06-25 20:12:58 +0200
commit9be428429d2b3a11423df18d3e2d27f24bbe4458 (patch)
tree2fd63c35fe4b186c6fdfdc0ae4ce5c1fca59223d /src/util/gnunet-config.c
parentcd8eebfb90c92314138e25f9cea5177f9b6014d5 (diff)
downloadgnunet-9be428429d2b3a11423df18d3e2d27f24bbe4458.tar.gz
gnunet-9be428429d2b3a11423df18d3e2d27f24bbe4458.zip
fix memory leak
Diffstat (limited to 'src/util/gnunet-config.c')
-rw-r--r--src/util/gnunet-config.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c
index 16b826ee2..532a5a0d6 100644
--- a/src/util/gnunet-config.c
+++ b/src/util/gnunet-config.c
@@ -75,20 +75,29 @@ print_option (void *cls,
75 const char *option, 75 const char *option,
76 const char *value) 76 const char *value)
77{ 77{
78 (void) section;
79 const struct GNUNET_CONFIGURATION_Handle *cfg = cls; 78 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
80 char *value_fn; 79
80 (void) section;
81 if (is_filename) 81 if (is_filename)
82 { 82 {
83 char *value_fn;
84 char *fn;
85
83 GNUNET_assert (GNUNET_OK == 86 GNUNET_assert (GNUNET_OK ==
84 GNUNET_CONFIGURATION_get_value_filename (cfg, 87 GNUNET_CONFIGURATION_get_value_filename (cfg,
85 section, 88 section,
86 option, 89 option,
87 &value_fn)); 90 &value_fn));
91 fn = GNUNET_STRINGS_filename_expand (value_fn);
92 if (NULL == fn)
93 fn = value_fn;
94 else
95 GNUNET_free (value_fn);
88 fprintf (stdout, 96 fprintf (stdout,
89 "%s = %s\n", 97 "%s = %s\n",
90 option, 98 option,
91 GNUNET_STRINGS_filename_expand (value_fn)); 99 fn);
100 GNUNET_free (fn);
92 } 101 }
93 else 102 else
94 { 103 {