diff --git a/main/config.c b/main/config.c
index 1884ec69c348893ec28c321d55870a01c67338b3..f02f3014b97a4bb4c312725aef41ef03193f9057 100644
--- a/main/config.c
+++ b/main/config.c
@@ -268,7 +268,7 @@ struct ast_variable *ast_variable_new(const char *name, const char *value, const
 		dst += name_len;
 		variable->value = strcpy(dst, value);
 		dst += fn_len;
-		variable->file = strcpy(dst, value);
+		variable->file = strcpy(dst, filename);
 	}
 	return variable;
 }