From 723cbe35048be54d66c550b0c917945e9645a303 Mon Sep 17 00:00:00 2001 From: darkrose Date: Sun, 20 Dec 2015 18:37:57 +1000 Subject: [PATCH] fix possible bug in http_request --- src/http.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/http.cpp b/src/http.cpp index 8efc776..b26e49d 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -534,10 +534,11 @@ std::string http_request(char* host, char* url, char* post, int port) HTTPResponseHeaders headers; int s; char buff[2048]; + std::string h; addr.setPort(port); if (!host || !host[0]) { - std::string h = g_settings->get("api_server"); + h = g_settings->get("api_server"); if (h == "") return ""; host = (char*)h.c_str();