diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-06-11 18:22:33 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-06-11 18:22:33 +0200 |
commit | 766fb6e2821dc84ccfe290e8906f12001e34043b (patch) | |
tree | 6db1e23ca9402076b9390a662b79f101ec58f750 /src/exchange/taler-exchange-httpd_wire.c | |
parent | f4b013b3d467f93482a00b208acf3a2874362fe7 (diff) | |
download | exchange-766fb6e2821dc84ccfe290e8906f12001e34043b.tar.gz exchange-766fb6e2821dc84ccfe290e8906f12001e34043b.tar.bz2 exchange-766fb6e2821dc84ccfe290e8906f12001e34043b.zip |
fixing more leaks
Diffstat (limited to 'src/exchange/taler-exchange-httpd_wire.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_wire.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-httpd_wire.c b/src/exchange/taler-exchange-httpd_wire.c index 79e69cc13..372e39bb6 100644 --- a/src/exchange/taler-exchange-httpd_wire.c +++ b/src/exchange/taler-exchange-httpd_wire.c @@ -27,6 +27,12 @@ #include <jansson.h> /** + * Cached JSON for /wire response. + */ +static json_t *wire_methods; + + +/** * Handle a "/wire" request. * * @param rh context of the handler @@ -43,8 +49,6 @@ TMH_WIRE_handler_wire (struct TMH_RequestHandler *rh, const char *upload_data, size_t *upload_data_size) { - static json_t *wire_methods; - if (NULL == wire_methods) wire_methods = TMH_VALIDATION_get_wire_methods ("exchange-wire-incoming"); @@ -54,4 +58,19 @@ TMH_WIRE_handler_wire (struct TMH_RequestHandler *rh, } +/** + * Initialize libgcrypt. + */ +void __attribute__ ((destructor)) +TEH_wire_cleanup () +{ + if (NULL != wire_methods) + { + json_decref (wire_methods); + wire_methods = NULL; + } +} + + + /* end of taler-exchange-httpd_wire.c */ |