aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-03-23 05:19:09 +0100
committerChristian Grothoff <grothoff@gnunet.org>2022-03-23 05:19:09 +0100
commit9b7716f9f2f8b3b4661ff07c891c8077e715062b (patch)
tree6e9a0f07a67252190d7bea1e5ac2b7c92b95d252
parent6505f6986939a18814fc5ad7a54d5aaa5e6cbfd4 (diff)
fix #7151
-rw-r--r--src/testing/testing_api_cmd_change_auth.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/testing/testing_api_cmd_change_auth.c b/src/testing/testing_api_cmd_change_auth.c
index 588eaa730..c3a60a1da 100644
--- a/src/testing/testing_api_cmd_change_auth.c
+++ b/src/testing/testing_api_cmd_change_auth.c
@@ -90,6 +90,22 @@ authchange_run (void *cls,
/**
+ * Call GNUNET_CURL_fini(). Done as a separate task to
+ * ensure that all of the command's cleanups have been
+ * executed first. See #7151.
+ *
+ * @param cls a `struct GNUNET_CURL_Context *` to clean up.
+ */
+static void
+deferred_cleanup_cb (void *cls)
+{
+ struct GNUNET_CURL_Context *ctx = cls;
+
+ GNUNET_CURL_fini (ctx);
+}
+
+
+/**
* Cleanup the state from a "authchange" CMD.
*
* @param cls closure.
@@ -104,7 +120,8 @@ authchange_cleanup (void *cls,
(void) cmd;
if (NULL != ss->old_ctx)
{
- GNUNET_CURL_fini (ss->old_ctx);
+ (void) GNUNET_SCHEDULER_add_now (&deferred_cleanup_cb,
+ ss->old_ctx);
ss->old_ctx = NULL;
}
GNUNET_free (ss);