Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix double-free.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 6 Sep 2022 16:00:27 +0000 (18:00 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 6 Sep 2022 16:00:27 +0000 (18:00 +0200)
src/kernel/resource/profile/ProfileBuilder.cpp

index 038a0ea..cba7f6d 100644 (file)
@@ -237,8 +237,8 @@ Profile* ProfileBuilder::from_file(const std::string& path)
 
 
 Profile* ProfileBuilder::from_void() {
-  static Profile void_profile("__void__", nullptr, -1.0);
-  return &void_profile;
+  static Profile* void_profile = new Profile("__void__", nullptr, -1.0);
+  return void_profile;
 }
 
 Profile* ProfileBuilder::from_callback(const std::string& name, const std::function<UpdateCb>& cb, double repeat_delay) {