Thanks for this handy library! I've already found a fix for this issue, but would prefer not to have to fork the project. If I can be allowed to push a feature branch to this repo, I'd be happy to share my fix. I don't know what kind of changes (if any) would be needed to the test suite, and unfortunately I don't have the time to figure that out. The fix is simply as follows, in include/restclient-cpp/connection.h:267:
...
==32204== Conditional jump or move depends on uninitialised value(s)
==32204== at 0x405DFB: std::char_traits<char>::length(char const*) (char_traits.h:320)
==32204== by 0x406099: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (basic_string.h:511)
==32204== by 0x7D6E036: RestClient::Connection::performCurlRequest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, RestClient::Response*) (connection.cc:533)
==32204== by 0x7D6D636: RestClient::Connection::performCurlRequest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (connection.cc:367)
==32204== by 0x7D6E2F4: RestClient::Connection::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (connection.cc:567)
==32204== by 0x7D6BB44: RestClient::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (restclient.cc:58)
...
Environment and debugging details
compiler and version: g++ (GCC) 8.3.0
operating system: Ubuntu 18.04.4 LTS
version of restclient-cpp 0.5.2 (commit ID b782bd2)
how did you install restclient-cpp? git clone, then cmake -D BUILD_SHARED_LIBS=OFF -D CMAKE_CXX_FLAGS="-g -fPIC" .. + make (I include this as a static lib in another shared lib that I build later)
libcurl version and compile flags – version below, I'm not sure how to get the compile flags:
Hi,
Thanks for this handy library! I've already found a fix for this issue, but would prefer not to have to fork the project. If I can be allowed to push a feature branch to this repo, I'd be happy to share my fix. I don't know what kind of changes (if any) would be needed to the test suite, and unfortunately I don't have the time to figure that out. The fix is simply as follows, in
include/restclient-cpp/connection.h:267
:Expected behaviour
no memory leaks in
valgrind
Actual behaviour
Relevant part of
valgrind
output:Environment and debugging details
g++ (GCC) 8.3.0
Ubuntu 18.04.4 LTS
0.5.2
(commit IDb782bd2
)git clone
, thencmake -D BUILD_SHARED_LIBS=OFF -D CMAKE_CXX_FLAGS="-g -fPIC" ..
+make
(I include this as a static lib in another shared lib that I build later)