Commit 65de509
selinux: fix double free
Clang's static analysis tool reports these double free memory errors.
security/selinux/ss/services.c:2987:4: warning: Attempt to free released memory [unix.Malloc]
kfree(bnames[i]);
^~~~~~~~~~~~~~~~
security/selinux/ss/services.c:2990:2: warning: Attempt to free released memory [unix.Malloc]
kfree(bvalues);
^~~~~~~~~~~~~~
So improve the security_get_bools error handling by freeing these variables
and setting their return pointers to NULL and the return len to 0
Cc: stable@vger.kernel.org
Signed-off-by: Tom Rix <trix@redhat.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>1 parent fe5a90b commit 65de509
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2888 | 2888 | | |
2889 | 2889 | | |
2890 | 2890 | | |
| 2891 | + | |
2891 | 2892 | | |
2892 | 2893 | | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
2893 | 2897 | | |
2894 | 2898 | | |
2895 | 2899 | | |
| |||
0 commit comments