aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igc/igc_main.c
diff options
context:
space:
mode:
authorOndrej Mosnacek <[email protected]>2020-04-14 14:23:51 +0000
committerPaul Moore <[email protected]>2020-04-15 21:23:16 +0000
commitaf15f14c8cfcee515f4e9078889045ad63efefe3 (patch)
tree1b200b5d57bc5479434ac08daa0b15027d23f06a /drivers/net/ethernet/intel/igc/igc_main.c
parentselinux: clean up indentation issue with assignment statement (diff)
downloadkernel-af15f14c8cfcee515f4e9078889045ad63efefe3.tar.gz
kernel-af15f14c8cfcee515f4e9078889045ad63efefe3.zip
selinux: free str on error in str_read()
In [see "Fixes:"] I missed the fact that str_read() may give back an allocated pointer even if it returns an error, causing a potential memory leak in filename_trans_read_one(). Fix this by making the function free the allocated string whenever it returns a non-zero value, which also makes its behavior more obvious and prevents repeating the same mistake in the future. Reported-by: coverity-bot <[email protected]> Addresses-Coverity-ID: 1461665 ("Resource leaks") Fixes: c3a276111ea2 ("selinux: optimize storage of filename transitions") Signed-off-by: Ondrej Mosnacek <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Paul Moore <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_main.c')
0 files changed, 0 insertions, 0 deletions