Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
DPL: Fix memory leak in variant_helper
  • Loading branch information
ktf committed Apr 19, 2024
commit 69b5961c1ceba53e2222c35728208ebe15c92d12
2 changes: 1 addition & 1 deletion Framework/Core/include/Framework/Variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ struct variant_helper<S, std::string_view> {

template <typename S>
struct variant_helper<S, std::string> {
static std::string get(const S* store) { return std::string(strdup(*reinterpret_cast<const char* const*>(store))); }
static std::string get(const S* store) { return std::string(*reinterpret_cast<const char* const*>(store)); }

static void set(S* store, std::string value) { *reinterpret_cast<char**>(store) = strdup(value.data()); }
};
Expand Down