summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 70d5da9ec..1fc53fe6a 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -124,7 +124,10 @@ GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src)
if (src->filename != NULL) c->filename = strdup(src->filename);
if (src->name != NULL) c->name = strdup(src->name);
if (src->info != NULL) c->info = strdup(src->info);
- if (src->error != NULL) c->error = strdup(src->error);
+ if (src->error != NULL) {
+ c->error = CallocT<GRFError>(1);
+ memcpy(c->error, src->error, sizeof(GRFError));
+ }
*dst = c;
dst = &c->next;