summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--newgrf_config.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/newgrf_config.c b/newgrf_config.c
index b70c8354f..6b74c99b2 100644
--- a/newgrf_config.c
+++ b/newgrf_config.c
@@ -120,9 +120,9 @@ GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src)
for (; src != NULL; src = src->next) {
c = calloc(1, sizeof(*c));
*c = *src;
- 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->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);
*dst = c;
dst = &c->next;