diff mbox

[03/14] UBUNTU: SAUCE: apparmor: fix reference count bug in label_merge_insert()

Message ID 20170201090606.22422-4-john.johansen@canonical.com
State New
Headers show

Commit Message

John Johansen Feb. 1, 2017, 9:05 a.m. UTC
@new does not have a reference taken locally and should not have its
reference put locally either.

BugLink: http://bugs.launchpad.net/bugs/1660833
Signed-off-by: John Johansen <john.johansen@canonical.com>
---
 security/apparmor/label.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox

Patch

diff --git a/security/apparmor/label.c b/security/apparmor/label.c
index 738fe52..05ac6d6 100644
--- a/security/apparmor/label.c
+++ b/security/apparmor/label.c
@@ -1083,7 +1083,6 @@  static struct aa_label *label_merge_insert(struct aa_label *new,
 		/* TODO: deal with reference labels */
 		if (new->size == 1) {
 			label = aa_get_label(&new->vec[0]->label);
-			aa_put_label(new);
 			return label;
 		}
 	} else if (!stale) {