summaryrefslogtreecommitdiff
path: root/src/testing/testing_cmd_challenge_answer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_cmd_challenge_answer.c')
-rw-r--r--src/testing/testing_cmd_challenge_answer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/testing/testing_cmd_challenge_answer.c b/src/testing/testing_cmd_challenge_answer.c
index ec8d03d..c9cb976 100644
--- a/src/testing/testing_cmd_challenge_answer.c
+++ b/src/testing/testing_cmd_challenge_answer.c
@@ -91,7 +91,7 @@ struct ChallengeState
/**
* code we read in the file generated by the plugin
*/
- char code[22];
+ char *code;
};
@@ -166,6 +166,7 @@ challenge_answer_cb (void *af_cls,
TALER_TESTING_interpreter_fail (cs->is);
return;
}
+ cs->code = GNUNET_malloc (22);
if (0 == fscanf (file,
"%21s",
cs->code))
@@ -480,6 +481,7 @@ challenge_cleanup (void *cls,
}
GNUNET_free (cs->payment_uri);
GNUNET_free (cs->order_id);
+ GNUNET_free (cs->code);
GNUNET_free (cs);
}
@@ -493,7 +495,7 @@ challenge_cleanup (void *cls,
* @param index index number of the object to extract.
* @return #GNUNET_OK on success
*/
-static int
+static enum GNUNET_GenericReturnValue
challenge_create_traits (void *cls,
const void **ret,
const char *trait,
@@ -502,7 +504,7 @@ challenge_create_traits (void *cls,
struct ChallengeState *cs = cls;
struct TALER_TESTING_Trait traits[] = {
ANASTASIS_TESTING_make_trait_code (
- (const char **) cs->code),
+ (const char **) &cs->code),
ANASTASIS_TESTING_make_trait_payment_secret (
&cs->payment_order_req),
TALER_TESTING_make_trait_payto_uri (