aboutsummaryrefslogtreecommitdiff
path: root/src/auditor
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-11-25 14:51:31 +0100
committerChristian Grothoff <christian@grothoff.org>2018-11-25 14:51:31 +0100
commit85aa6d17c727a5899490aa82b0ece9ac95972c66 (patch)
tree166a80ac1f86a7732b8d502f2b9070b4d57e33f7 /src/auditor
parent5052698cbc6692c922e75081af12ad24bf8c3e69 (diff)
fix misc. memory leaks
Diffstat (limited to 'src/auditor')
-rw-r--r--src/auditor/taler-auditor-httpd.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c
index 5e1d1b169..c7c2589c6 100644
--- a/src/auditor/taler-auditor-httpd.c
+++ b/src/auditor/taler-auditor-httpd.c
@@ -314,16 +314,19 @@ handle_version (struct TAH_RequestHandler *rh,
const char *upload_data,
size_t *upload_data_size)
{
- json_t *ver;
+ static json_t *ver; /* we build the response only once, keep around for next query! */
(void) rh;
(void) upload_data;
(void) upload_data_size;
(void) connection_cls;
- ver = json_pack ("{s:s, s:s, s:o}",
- "version", AUDITOR_PROTOCOL_VERSION,
- "currency", currency,
- "auditor_public_key", GNUNET_JSON_from_data_auto (&auditor_pub));
+ if (NULL == ver)
+ {
+ ver = json_pack ("{s:s, s:s, s:o}",
+ "version", AUDITOR_PROTOCOL_VERSION,
+ "currency", currency,
+ "auditor_public_key", GNUNET_JSON_from_data_auto (&auditor_pub));
+ }
if (NULL == ver)
{
GNUNET_break (0);
@@ -616,8 +619,10 @@ auditor_serve_process_config ()
GNUNET_free (auditor_key_file);
return 1;
}
+ GNUNET_free (auditor_key_file);
GNUNET_CRYPTO_eddsa_key_get_public (eddsa_priv,
&auditor_pub.eddsa_pub);
+ GNUNET_free (eddsa_priv);
}
else
{