You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/06/14 17:03:50 UTC

[GitHub] [incubator-nuttx-apps] gustavonihei commented on a change in pull request #765: netutils/webclient: fix the fd leak during connect(2) fail

gustavonihei commented on a change in pull request #765:
URL: https://github.com/apache/incubator-nuttx-apps/pull/765#discussion_r651124009



##########
File path: netutils/webclient/webclient.c
##########
@@ -903,8 +903,7 @@ int webclient_perform(FAR struct webclient_context *ctx)
       if (ret < 0)
         {
           nerr("ERROR: connect failed: %d\n", errno);
-          free(ws);
-          return ret;
+          goto errout_with_errno;

Review comment:
       Won't this end up closing the socket twice?
   In case `connect` fails, line 899 already closes the socket.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org