From 8cea842c84d783bcdaec2c3f77b0099e01a3c324 Mon Sep 17 00:00:00 2001 From: DavidWalz Date: Wed, 23 Mar 2016 08:42:34 +0100 Subject: [PATCH] fix double free error in crpropa-xmlrun --- src/XmlExecute.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/XmlExecute.cpp b/src/XmlExecute.cpp index 51612a634..05177afe7 100644 --- a/src/XmlExecute.cpp +++ b/src/XmlExecute.cpp @@ -292,10 +292,10 @@ bool XmlExecute::load(const string &filename) { loadSpectrumComposition(node); // ----- observers ----- - /*observer = new Observer();*/ - modules.add(&observer); + ref_ptr observer = new Observer(); + modules.add(observer); if (is1D) { - observer.add(new ObserverPoint()); + observer->add(new ObserverPoint()); } else { node = root.child("Observers"); if (!node) {