mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 02:17:37 +08: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:
@@ -1596,9 +1596,8 @@ int webclient_perform(FAR struct webclient_context *ctx)
|
|||||||
/* Could not resolve host (or malformed IP address) */
|
/* Could not resolve host (or malformed IP address) */
|
||||||
|
|
||||||
nwarn("WARNING: Failed to resolve hostname\n");
|
nwarn("WARNING: Failed to resolve hostname\n");
|
||||||
free_ws(ws);
|
ret = -EHOSTUNREACH;
|
||||||
_SET_STATE(ctx, WEBCLIENT_CONTEXT_STATE_DONE);
|
goto errout_with_errno;
|
||||||
return -EHOSTUNREACH;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
server_address = (const struct sockaddr *)&server_in;
|
server_address = (const struct sockaddr *)&server_in;
|
||||||
|
Reference in New Issue
Block a user