diff --git a/README.md b/README.md index a714596..eae4847 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,6 @@ static const char Greeting[] = "Hello, "; int32_t EXTISM_EXPORTED_FUNCTION(greet) { ExtismHandle key = extism_alloc_buf_from_sz("user"); ExtismHandle value = extism_config_get(key); - extism_free(key); if (value == 0) { ExtismHandle err = extism_alloc_buf_from_sz("Invalid key"); @@ -233,11 +232,6 @@ int32_t EXTISM_EXPORTED_FUNCTION(count) { // Set the variable extism_var_set(key, value); - // Free key/value, vars are stored on the host side so they remain - // available between calls - extism_free(value); - extism_free(key); - return 0; } ``` diff --git a/extism-pdk.h b/extism-pdk.h index cf09ea9..f82eadf 100644 --- a/extism-pdk.h +++ b/extism-pdk.h @@ -426,7 +426,6 @@ void extism_log(const char *s, const size_t len, const ExtismLog level) { extism_log_error(buf); break; } - extism_free(buf); } // Write zero-terminated string to Extism log @@ -479,7 +478,6 @@ void extism_error_set_buf_from_sz(const char *message) { ExtismHandle extism_config_get_buf(const char *name, const size_t nameLen) { ExtismHandle key = extism_alloc_buf(name, nameLen); ExtismHandle value = extism_config_get(key); - extism_free(key); return value; } @@ -493,7 +491,6 @@ ExtismHandle extism_config_get_buf_from_sz(const char *name) { ExtismHandle extism_var_get_buf(const char *name, const size_t nameLen) { ExtismHandle key = extism_alloc_buf(name, nameLen); ExtismHandle value = extism_var_get(key); - extism_free(key); return value; } @@ -508,7 +505,6 @@ void extism_var_set_buf(const char *name, const size_t nameLen, const ExtismHandle value) { ExtismHandle key = extism_alloc_buf(name, nameLen); extism_var_set(key, value); - extism_free(key); } // store a var from a sz key