mirror of
https://github.com/fluencelabs/fluid
synced 2025-04-25 14:52:19 +00:00
add memory cleaning
This commit is contained in:
parent
e81ad192d3
commit
f5ddb09b8b
@ -15,7 +15,7 @@ fi
|
|||||||
# Build fluid WASM module
|
# Build fluid WASM module
|
||||||
echo "Building to WASM..."
|
echo "Building to WASM..."
|
||||||
docker-compose up --build
|
docker-compose up --build
|
||||||
cp fluid.wasm wasm/
|
mv fluid.wasm wasm/
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Run it all on 30000 port with default Fluence API
|
# Run it all on 30000 port with default Fluence API
|
||||||
|
@ -53,6 +53,7 @@ const char *invoke(char *str, int length) {
|
|||||||
char *error = (char *)malloc(1024);
|
char *error = (char *)malloc(1024);
|
||||||
const int error_size = snprintf(error, 1024, "%s given as the action field, but only `Post` and `Fetch` are supported", action);
|
const int error_size = snprintf(error, 1024, "%s given as the action field, but only `Post` and `Fetch` are supported", action);
|
||||||
result = prepare_response(error, error_size);
|
result = prepare_response(error, error_size);
|
||||||
|
free(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -141,5 +142,8 @@ const char *fetch_posts_request(const json_t *json) {
|
|||||||
|
|
||||||
const int result_out_len = snprintf(result_out, result_len, "{ posts: \"%s\" }", result);
|
const int result_out_len = snprintf(result_out, result_len, "{ posts: \"%s\" }", result);
|
||||||
|
|
||||||
return prepare_response(result_out, result_out_len);
|
const char *prepared_response = prepare_response(result_out, result_out_len);
|
||||||
|
free(result_out);
|
||||||
|
|
||||||
|
return prepared_response;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user