mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
netutils/webclient: Fix bug that the socket is not close
Fix to close socket when it fails to resolve hostname.
This commit is contained in:
parent
913792c7be
commit
66f6e5f048
1 changed files with 2 additions and 3 deletions
|
|
@ -1596,9 +1596,8 @@ int webclient_perform(FAR struct webclient_context *ctx)
|
|||
/* Could not resolve host (or malformed IP address) */
|
||||
|
||||
nwarn("WARNING: Failed to resolve hostname\n");
|
||||
free_ws(ws);
|
||||
_SET_STATE(ctx, WEBCLIENT_CONTEXT_STATE_DONE);
|
||||
return -EHOSTUNREACH;
|
||||
ret = -EHOSTUNREACH;
|
||||
goto errout_with_errno;
|
||||
}
|
||||
|
||||
server_address = (const struct sockaddr *)&server_in;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue