Commit 694d04e8 authored by John Johansen's avatar John Johansen Committed by Tim Gardner

UBUNTU: SAUCE: apparmor: Fix: refcount leak in aa_label_merge

if aa_label_alloc() fails the refs taken on a and b are leaked.
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent bb2197f2
......@@ -1099,7 +1099,7 @@ struct aa_label *aa_label_merge(struct aa_label *a, struct aa_label *b,
*/
new = aa_label_alloc(a->size + b->size, gfp);
if (!new)
return NULL;
goto out;
write_lock_irqsave(&ls->lock, flags);
label = __label_merge_insert(ls, new, a, b);
......@@ -1110,6 +1110,7 @@ struct aa_label *aa_label_merge(struct aa_label *a, struct aa_label *b,
new = NULL;
}
aa_put_label(new);
out:
aa_put_label(a);
aa_put_label(b);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment