aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_change_auth.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-12-02 06:41:49 +0100
committerChristian Grothoff <christian@grothoff.org>2021-12-02 06:41:49 +0100
commite8fc5d8d5c5eb07c9b6be41fd9bab0552a6ac672 (patch)
treeaeb706e4007fda0061db507217e1e612a7fa1a7d /src/testing/testing_api_cmd_change_auth.c
parent170402203ae8ba7060da8149de47c875ff4d1946 (diff)
downloadexchange-e8fc5d8d5c5eb07c9b6be41fd9bab0552a6ac672.tar.xz
-fix command to avoid timing-dependent assertion failure
Diffstat (limited to 'src/testing/testing_api_cmd_change_auth.c')
-rw-r--r--src/testing/testing_api_cmd_change_auth.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/testing/testing_api_cmd_change_auth.c b/src/testing/testing_api_cmd_change_auth.c
index 2f0f95b79..588eaa730 100644
--- a/src/testing/testing_api_cmd_change_auth.c
+++ b/src/testing/testing_api_cmd_change_auth.c
@@ -37,6 +37,11 @@ struct AuthchangeState
* What is the new authorization token to send?
*/
const char *auth_token;
+
+ /**
+ * Old context, clean up on termination.
+ */
+ struct GNUNET_CURL_Context *old_ctx;
};
@@ -55,11 +60,7 @@ authchange_run (void *cls,
struct AuthchangeState *ss = cls;
(void) cmd;
- if (NULL != is->ctx)
- {
- GNUNET_CURL_fini (is->ctx);
- is->ctx = NULL;
- }
+ ss->old_ctx = is->ctx;
if (NULL != is->rc)
{
GNUNET_CURL_gnunet_rc_destroy (is->rc);
@@ -101,6 +102,11 @@ authchange_cleanup (void *cls,
struct AuthchangeState *ss = cls;
(void) cmd;
+ if (NULL != ss->old_ctx)
+ {
+ GNUNET_CURL_fini (ss->old_ctx);
+ ss->old_ctx = NULL;
+ }
GNUNET_free (ss);
}