Skip to content

Commit

Permalink
SELinux: fix memory leak in security_netlbl_cache_add()
Browse files Browse the repository at this point in the history
Fix memory leak in security_netlbl_cache_add()
Note: The Coverity checker gets credit for spotting this one.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: James Morris <jmorris@namei.org>
Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>
  • Loading branch information
Jesper Juhl authored and James Morris committed Jul 23, 2007
1 parent f695baf commit 0ec8abd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion security/selinux/ss/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -2417,8 +2417,10 @@ static void security_netlbl_cache_add(struct netlbl_lsm_secattr *secattr,

cache->type = NETLBL_CACHE_T_MLS;
if (ebitmap_cpy(&cache->data.mls_label.level[0].cat,
&ctx->range.level[0].cat) != 0)
&ctx->range.level[0].cat) != 0) {
kfree(cache);
return;
}
cache->data.mls_label.level[1].cat.highbit =
cache->data.mls_label.level[0].cat.highbit;
cache->data.mls_label.level[1].cat.node =
Expand Down

0 comments on commit 0ec8abd

Please sign in to comment.