This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 412cf2b  webclient: Fix a use of uninitialized variable
412cf2b is described below

commit 412cf2b955764e54c6bdeb2a828a5305c183cda9
Author: YAMAMOTO Takashi <yamam...@midokura.com>
AuthorDate: Wed Jan 20 10:03:59 2021 +0900

    webclient: Fix a use of uninitialized variable
    
    Detected by clang static analyzer.
---
 netutils/webclient/webclient.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/netutils/webclient/webclient.c b/netutils/webclient/webclient.c
index 539c7a8..f9f7d73 100644
--- a/netutils/webclient/webclient.c
+++ b/netutils/webclient/webclient.c
@@ -777,8 +777,8 @@ int webclient_perform(FAR struct webclient_context *ctx)
                   /* Could not resolve host (or malformed IP address) */
 
                   nwarn("WARNING: Failed to resolve hostname\n");
-                  ret = -EHOSTUNREACH;
-                  goto errout_with_errno;
+                  free(ws);
+                  return -EHOSTUNREACH;
                 }
 
               server_address = (const struct sockaddr *)&server_in;

Reply via email to