# \[PATCH 3.12 059/100\] apparmor: fix ref count leak when profile sha1 hash is read

- From: Jiri Slaby \<hidden\>
- Date: 2016-08-19 07:22:49 
- List: stable
- Page: https://ratatoskr.run/stable/2016/08/4818064
- Thread: https://ratatoskr.run/stable/2016/08/4818008/t.md

```text
From: John Johansen <john.johansen@canonical.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 0b938a2e2cf0b0a2c8bac9769111545aff0fee97 upstream.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <redacted>
Signed-off-by: Jiri Slaby <redacted>
---
 security/apparmor/apparmorfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 7db9954f1af2..b30489856741 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -331,6 +331,7 @@ static int aa_fs_seq_hash_show(struct seq_file *seq, void *v)
 			seq_printf(seq, "%.2x", profile->hash[i]);
 		seq_puts(seq, "\n");
 	}
+	aa_put_profile(profile);
 
 	return 0;
 }
-- 
2.9.3

```
