History

kernel/auditfilter.c: fix leak in audit_add_rule() error path

If both 'tree' and 'watch' are valid we must call audit_put_tree(), just like the preceding code within audit_add_rule().

Chen Gang committed 13 years ago

Commit 2f992ee1 parent 6beb8a21 file · +6 −0Browse files

Showing the changes to kernel/auditfilter.c (1 of 1 file). Show all

Unified · Split

kernel/auditfilter.c+6−0
@@ -865,6 +865,12 @@ static inline int audit_add_rule(struct audit_entry *entry) · 864 unmodified lines
865 err = audit_add_watch(&entry->rule, &list);865 err = audit_add_watch(&entry->rule, &list);
866 if (err) {866 if (err) {
867 mutex_unlock(&audit_filter_mutex);867 mutex_unlock(&audit_filter_mutex);
868 /*
869 * normally audit_add_tree_rule() will free it
870 * on failure
871 */
872 if (tree)
873 audit_put_tree(tree);
868 goto error;874 goto error;
869 }875 }
870 }876 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t