Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit effd54b

Browse files
author
Yu Wei Wu
committed
fix(api): Reorder send mam init for better memory free
1 parent 8b04585 commit effd54b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

accelerator/apis.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,17 @@ status_t api_mam_send_message(const iota_config_t* const tangle,
210210
send_mam_req_t* req = send_mam_req_new();
211211
send_mam_res_t* res = send_mam_res_new();
212212

213-
ret = send_mam_req_deserialize(payload, req);
214-
if (ret) {
215-
goto done;
216-
}
217-
218213
// Creating MAM API
219214
if (mam_api_init(&mam, (tryte_t*)SEED)) {
220215
ret = SC_MAM_FAILED_INIT;
221216
goto done;
222217
}
223218

219+
ret = send_mam_req_deserialize(payload, req);
220+
if (ret) {
221+
goto done;
222+
}
223+
224224
// Create mam channel
225225
if (mam_channel_t_set_size(mam.channels) == 0) {
226226
mam_api_create_channel(&mam, tangle->mss_depth, channel_id);

0 commit comments

Comments
 (0)