More unnecessary string duplication

This commit is contained in:
Simon Robertshaw
2013-03-12 21:29:27 +00:00
parent 35b7f62d3b
commit 7a055a9d90

View File

@@ -121,7 +121,7 @@ void Client::Initialise(std::string proxyString)
} }
if(proxyString.length()) if(proxyString.length())
http_init(proxyString.c_str()); http_init((char*)proxyString.c_str());
else else
http_init(NULL); http_init(NULL);
@@ -411,12 +411,7 @@ void Client::SetProxy(std::string proxy)
{ {
http_done(); http_done();
if(proxy.length()) if(proxy.length())
{ http_init((char*)proxy.c_str());
char *tempproxy = new char[proxy.length() + 1];
std::strcpy (tempproxy, proxy.c_str());
http_init(tempproxy);
delete[] tempproxy;
}
else else
http_init(NULL); http_init(NULL);
} }