Attestation: Free JSON from the Wasm module heap (#2803)

The JSON evidence is allocated on the module instance heap, but no API
was given to dispose of this memory buffer. The sample mentions using
the function free, which behaves differently depending on the
execution context.

This fix provides a new function called librats_dispose_evidence_json,
enabling freeing the JSON evidence directly from the Wasm app.
This commit is contained in:
Jämes Ménétrey
2023-11-22 03:48:14 +01:00
committed by GitHub
parent 4d5eb346fc
commit f9e8b9535e
3 changed files with 17 additions and 4 deletions

View File

@ -106,7 +106,7 @@ main(int argc, char **argv)
err:
if (evidence_json) {
free(evidence_json);
librats_dispose_evidence_json(evidence_json);
}
if (evidence) {