Skip to content

Commit

Permalink
DPL: Fix memory leak in variant_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Apr 22, 2024
1 parent 88838a8 commit f5ebb69
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit f5ebb69

Please sign in to comment.