- 
                Notifications
    
You must be signed in to change notification settings  - Fork 727
 
Open
Description
wasm-micro-runtime/core/iwasm/common/wasm_runtime_common.c
Lines 3814 to 3843 in 3bf08a0
| for (i = 0; i < addr_pool_size; i++) { | |
| char *cp, *address, *mask; | |
| bool ret = false; | |
| cp = bh_strdup(addr_pool[i]); | |
| if (!cp) { | |
| set_error_buf(error_buf, error_buf_size, | |
| "Init wasi environment failed: copy address failed"); | |
| goto fail; | |
| } | |
| address = strtok(cp, "/"); | |
| mask = strtok(NULL, "/"); | |
| if (!mask) { | |
| snprintf(error_buf, error_buf_size, | |
| "Invalid address pool entry: %s, must be in the format of " | |
| "ADDRESS/MASK", | |
| addr_pool[i]); | |
| goto fail; | |
| } | |
| ret = addr_pool_insert(apool, address, (uint8)atoi(mask)); | |
| wasm_runtime_free(cp); | |
| if (!ret) { | |
| set_error_buf(error_buf, error_buf_size, | |
| "Init wasi environment failed: store address failed"); | |
| goto fail; | |
| } | |
| } | 
It seems that cp is not freed in some failure paths.
Please check whether this observation is correct.
Metadata
Metadata
Assignees
Labels
No labels