Skip to content

Commit 4cedf8e

Browse files
committed
Free model_name
1 parent fa5ce41 commit 4cedf8e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/iwasm/libraries/wasi-nn/src/wasi_nn.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,10 @@ wasi_nn_load_by_name(wasm_exec_env_t exec_env, char *name, uint32_t name_len,
658658
if (model_name && strcmp(nul_terminated_name, model_name) == 0) {
659659
is_loaded = wasm_runtime_get_wasi_nn_global_ctx_loaded_i(
660660
wasi_nn_global_ctx, model_idx);
661+
free(model_name);
661662
break;
662663
}
664+
free(model_name);
663665
}
664666

665667
if (!is_loaded && (model_idx < MAX_GLOBAL_GRAPHS_PER_INST)

0 commit comments

Comments
 (0)