Fix issues reported by Coverity (#1775)

Fix some issues reported by Coverity and fix windows exception
check with guard page issue
This commit is contained in:
Wenyong Huang
2022-12-01 19:24:13 +08:00
committed by GitHub
parent 6eaf779a2d
commit 1652f22a77
5 changed files with 45 additions and 35 deletions

View File

@ -3081,14 +3081,15 @@ wasi_ssp_sock_addr_resolve(
size_t _max_info_size;
size_t actual_info_size;
if (!ns_lookup_list_search(ns_lookup_list, host)) {
return __WASI_EACCES;
}
if (!wamr_addr_info) {
return __WASI_ENOMEM;
}
if (!ns_lookup_list_search(ns_lookup_list, host)) {
wasm_runtime_free(wamr_addr_info);
return __WASI_EACCES;
}
int ret = os_socket_addr_resolve(
host, service, hints->hints_enabled ? &hints_is_tcp : NULL,
hints->hints_enabled ? &hints_is_ipv4 : NULL, wamr_addr_info,