]> granicus.if.org Git - curl/commitdiff
connect: make sure that rc is initialized in singleipconnect()
authorKamil Dudka <kdudka@redhat.com>
Tue, 19 Apr 2016 07:38:44 +0000 (09:38 +0200)
committerKamil Dudka <kdudka@redhat.com>
Tue, 19 Apr 2016 07:38:44 +0000 (09:38 +0200)
This commit fixes a Clang warning introduced in curl-7_48_0-190-g8f72b13:

Error: CLANG_WARNING:
lib/connect.c:1120:11: warning: The right operand of '==' is a garbage value
1118|       }
1119|
1120|->     if(-1 == rc)
1121|         error = SOCKERRNO;
1122|     }

lib/connect.c

index bfc22992c34790938c1821168d18790ced706ec0..6ed9b024a8afa93dbdb3c63711c6d6e96f28c80d 100644 (file)
@@ -1008,7 +1008,7 @@ static CURLcode singleipconnect(struct connectdata *conn,
                                 curl_socket_t *sockp)
 {
   struct Curl_sockaddr_ex addr;
-  int rc;
+  int rc = -1;
   int error = 0;
   bool isconnected = FALSE;
   struct SessionHandle *data = conn->data;