BACKPORT: security: smack: fix memleak in smk_write_rules_list()
authorTomasz Stanislawski <t.stanislaws@samsung.com>
Thu, 6 Jun 2013 07:30:50 +0000 (09:30 +0200)
committerRafal Krypa <r.krypa@samsung.com>
Thu, 30 Jun 2016 12:57:26 +0000 (14:57 +0200)
commit933a1e5a081d21c09f0fa0804195ec5dcb335731
tree716a41ba76c0d06486f0218697d8e0dfb23ccc54
parent7ff6223b91bc5a90f189bbd95bd2f1f19e908328
BACKPORT: security: smack: fix memleak in smk_write_rules_list()

The smack_parsed_rule structure is allocated.  If a rule is successfully
installed then the last reference to the object is lost.  This patch fixes this
leak. Moreover smack_parsed_rule is allocated on stack because it no longer
needed ofter smk_write_rules_list() is finished.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
(cherry-picked from upstream 470043ba995a79a274a5db306856975002a06f19)
security/smack/smackfs.c