summaryrefslogtreecommitdiff
path: root/src/base_consist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base_consist.cpp')
-rw-r--r--src/base_consist.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/base_consist.cpp b/src/base_consist.cpp
index def120fe1..93b97e10e 100644
--- a/src/base_consist.cpp
+++ b/src/base_consist.cpp
@@ -12,6 +12,11 @@
#include "stdafx.h"
#include "base_consist.h"
+BaseConsist::~BaseConsist()
+{
+ free(this->name);
+}
+
/**
* Copy properties of other BaseConsist.
* @param src Source for copying
@@ -20,6 +25,9 @@ void BaseConsist::CopyConsistPropertiesFrom(const BaseConsist *src)
{
if (this == src) return;
+ free(this->name);
+ this->name = src->name != NULL ? strdup(src->name) : NULL;
+
this->service_interval = src->service_interval;
this->cur_real_order_index = src->cur_real_order_index;
}