summaryrefslogtreecommitdiff
path: root/src/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/link.c')
-rw-r--r--src/link.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/link.c b/src/link.c
index ca497a7..c8c510a 100644
--- a/src/link.c
+++ b/src/link.c
@@ -1326,9 +1326,11 @@ static int copy_avrule_list(avrule_t * list, avrule_t ** dst,
}
new_rule->line = cur->line;
new_rule->source_line = cur->source_line;
- new_rule->source_filename = strdup(cur->source_filename);
- if (!new_rule->source_filename)
- goto cleanup;
+ if (cur->source_filename) {
+ new_rule->source_filename = strdup(cur->source_filename);
+ if (!new_rule->source_filename)
+ goto cleanup;
+ }
cur = cur->next;