Fix possible memleak when parsing rule file