Fix an unlikely leak in HTTPInput.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 22 Dec 2018 00:24:26 +0000 (01:24 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 22 Dec 2018 00:24:26 +0000 (01:24 +0100)
Found by Coverity Scan.

httpinput.cpp

index bac6b05..cbffe3a 100644 (file)
@@ -167,6 +167,7 @@ int HTTPInput::lookup_and_connect(const string &host, const string &port)
                if (ioctl(sock, FIONBIO, &one) == -1) {
                        log_perror("ioctl(FIONBIO)");
                        safe_close(sock);
+                       freeaddrinfo(base_ai);
                        return -1;                      
                }