summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-09-25 19:08:11 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-09-25 19:08:11 +0200
commita5dde6ea469c81cd92efda20a1fce9ccfa4a339b (patch)
tree4b01dbff74c5ce7fa02bd012e711005e160cac3f /src
parentdd298986171a47934ceeb52455c51f7ffaa1afe9 (diff)
downloadexchange-a5dde6ea469c81cd92efda20a1fce9ccfa4a339b.tar.gz
exchange-a5dde6ea469c81cd92efda20a1fce9ccfa4a339b.tar.bz2
exchange-a5dde6ea469c81cd92efda20a1fce9ccfa4a339b.zip
Fix cherry-pick test case.
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-httpd_keystate.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_keystate.c b/src/exchange/taler-exchange-httpd_keystate.c
index ce2eafa71..5af391aca 100644
--- a/src/exchange/taler-exchange-httpd_keystate.c
+++ b/src/exchange/taler-exchange-httpd_keystate.c
@@ -2091,6 +2091,20 @@ TEH_KS_handler_keys (struct TEH_RequestHandler *rh,
? krd->response_compressed
: krd->response_uncompressed);
TEH_KS_release (key_state);
+
+ /**
+ * Not the best style, but needed since the logic has this
+ * dual behaviour: some functions touch directly the global
+ * variable, some others want the key state passed in the
+ * arguments.
+ *
+ * NOTE, this NULL-ification is needed because otherwise
+ * the internal key state object gets left with refcnt == 0
+ * and a non-NULL global pointer to it.
+ */
+ if (internal_key_state == key_state)
+ internal_key_state = NULL;
+
return ret;
}