Closed sdobbs closed 4 months ago
Oh! Will put a fix
P.S. Actually for a long time I wanted to throw out that string management. P.P.S It is very sad that even now each c++ project should start either with boost or other side library or with reinventing a wheel. C++20 has some promises but when will we be able to use it? In 2030?
vFormat() has been removed, right?
I have been hunting down some memory problems which are causing hd_root jobs to crash, and came across a possible memory leak in ccdb::StringUtils::vFormat() located in src/Library/Helpers/StringUtils.cc
I think the issue is that there is a malloc() for a variable buffer in line 67, and then the function ends with line 97:
return string(buffer);
So, this should return a new string variable with a copy of the contents of buffer, but the actual buffer is never freed.
This leaks several MB of memory...