summaryrefslogtreecommitdiff
path: root/src/expand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expand.c')
-rw-r--r--src/expand.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/expand.c b/src/expand.c
index 947bee0..acb6906 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -2651,9 +2651,11 @@ static int copy_neverallow(policydb_t * dest_pol, uint32_t * typemap,
avrule->line = source_rule->line;
avrule->flags = source_rule->flags;
avrule->source_line = source_rule->source_line;
- avrule->source_filename = strdup(source_rule->source_filename);
- if (!avrule->source_filename)
- goto err;
+ if (source_rule->source_filename) {
+ avrule->source_filename = strdup(source_rule->source_filename);
+ if (!avrule->source_filename)
+ goto err;
+ }
if (ebitmap_cpy(&avrule->stypes.types, &stypes))
goto err;