Merge git://git.infradead.org/users/eparis/audit
[linux-3.10.git] / kernel / auditfilter.c
index bc6595f..83a2970 100644 (file)
@@ -533,6 +533,10 @@ exit_nofree:
        return entry;
 
 exit_free:
+       if (entry->rule.watch)
+               audit_put_watch(entry->rule.watch); /* matches initial get */
+       if (entry->rule.tree)
+               audit_put_tree(entry->rule.tree); /* that's the temporary one */
        audit_free_rule(entry);
        return ERR_PTR(err);
 }