-
Notifications
You must be signed in to change notification settings - Fork 248
Open
Labels
Description
In structured_data.cc
, we do
char *filename = static_cast<char *>(std::malloc (maxsize * sizeof(char)));
int ret = std::snprintf (filename,
maxsize,
filename_and_path.c_str(),
boundary_name.c_str(),
filenumber);
AssertThrow(ret >= 0, ExcMessage("Invalid string placeholder in filename detected."));
AssertThrow(ret< maxsize, ExcInternalError("snprintf string overflow detected."));
const std::string str_result (filename);
std::free (filename);
We should avoid the use of malloc()
and free()
and instead replace the explicit memory allocation via the use of a std::unique_ptr
and std::make_unique()
.