Fix some issues reported by Coverity (#1150)
module_wasm_app.c: add return value check for wasm_runtime_call_wasm aot_runtime.c: add return value check for aot_get_default_memory aot_runtime.c: add return value check before calling wasm app malloc/free func wasm_runtime_common.c: fix dead code warning in wasm_runtime_load_from_sections aot_emit_memory.c: fix potential integer overflow issue wasm_runtime.c: remove dead code in memory_instantiate, add assertion for globals samples simple/gui/littlevgl: fix fields of struct sigaction initialization issue host-tool: add return value check for sendto
This commit is contained in:
@ -125,6 +125,7 @@ bool
|
||||
udp_send(const char *address, int port, const char *buf, int len)
|
||||
{
|
||||
int sockfd;
|
||||
ssize_t size_sent;
|
||||
struct sockaddr_in servaddr;
|
||||
|
||||
if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
|
||||
@ -136,11 +137,11 @@ udp_send(const char *address, int port, const char *buf, int len)
|
||||
servaddr.sin_port = htons(port);
|
||||
servaddr.sin_addr.s_addr = INADDR_ANY;
|
||||
|
||||
sendto(sockfd, buf, len, MSG_CONFIRM, (const struct sockaddr *)&servaddr,
|
||||
sizeof(servaddr));
|
||||
size_sent = sendto(sockfd, buf, len, MSG_CONFIRM,
|
||||
(const struct sockaddr *)&servaddr, sizeof(servaddr));
|
||||
|
||||
close(sockfd);
|
||||
return true;
|
||||
return (size_sent != -1) ? true : false;
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user