diff --git a/src/h2load.cc b/src/h2load.cc index cffca894..30446b4a 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -303,7 +303,7 @@ int Client::connect() { return -1; } } else { - addrinfo *addr; + addrinfo *addr = nullptr; while (next_addr) { addr = next_addr; next_addr = next_addr->ai_next; @@ -317,6 +317,8 @@ int Client::connect() { return -1; } + assert(addr); + current_addr = addr; } diff --git a/src/template.h b/src/template.h index f842cdd2..c13008ed 100644 --- a/src/template.h +++ b/src/template.h @@ -27,6 +27,7 @@ #include "nghttp2_config.h" +#include #include #include #include