Message ID | 20240909020347.960015-3-koichiro.den@canonical.com |
---|---|
State | New |
Headers | show |
Series | CVE-2022-48740 | expand |
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index be1be450fc57..2b504c169cd9 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c @@ -158,6 +158,8 @@ static void cond_list_destroy(struct policydb *p) for (i = 0; i < p->cond_list_len; i++) cond_node_destroy(&p->cond_list[i]); kfree(p->cond_list); + p->cond_list = NULL; + p->cond_list_len = 0; } void cond_policydb_destroy(struct policydb *p) @@ -472,7 +474,6 @@ int cond_read_list(struct policydb *p, void *fp) return 0; err: cond_list_destroy(p); - p->cond_list = NULL; return rc; }