]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
hostip: fix 'potentially uninitialized variable' warning
authorJay Satiro <raysatiro@yahoo.com>
Tue, 20 Feb 2018 19:29:50 +0000 (14:29 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 20 Feb 2018 19:30:47 +0000 (14:30 -0500)
Follow-up to 50d1b33.

Caught by AppVeyor.

lib/hostip.c

index 8310c83e1e82e6a04a6f34aa00525af24b3b20b9..895c132948b0e5e9b03b6b688a814a81a43a5aec 100644 (file)
@@ -823,7 +823,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data)
       char *entry_id;
       size_t entry_len;
       char address[64];
-      char *addresses;
+      char *addresses = NULL;
       char *addr_begin;
       char *addr_end;
       char *port_ptr;
@@ -842,7 +842,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data)
 
       port_ptr = host_end + 1;
       tmp_port = strtoul(port_ptr, &end_ptr, 10);
-      if(end_ptr == port_ptr || tmp_port > USHRT_MAX || *end_ptr != ':')
+      if(tmp_port > USHRT_MAX || end_ptr == port_ptr || *end_ptr != ':')
         goto err;
 
       port = (int)tmp_port;