linux/fs/cifsd
Muhammad Usama Anjum c250e8f556 cifsd: fix memory leak when loop ends
Memory is being allocated and if veto_list is zero, the loop breaks
without cleaning up the allocated memory. In this patch, the length
check has been moved before allocation. If loop breaks, the memory isn't
allocated in the first place. Thus the memory is being protected from
leaking.

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1503590 ("Resource leaks")
Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-05-10 19:15:35 -05:00
..
mgmt cifsd: fix memory leak when loop ends 2021-05-10 19:15:35 -05:00
asn1.c
asn1.h
auth.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
auth.h
buffer_pool.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
buffer_pool.h cifsd: add file operations 2021-05-10 19:15:16 -05:00
connection.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
connection.h cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
crypto_ctx.c
crypto_ctx.h
glob.h cifsd: remove stale prototype and variables 2021-05-10 19:15:35 -05:00
Kconfig cifsd: fix implicit declaration of function 'locks_alloc_lock' 2021-05-10 19:15:31 -05:00
ksmbd_server.h cifsd: remove smack inherit leftovers 2021-05-10 19:15:32 -05:00
ksmbd_work.c cifsd: remove unneeded macros 2021-05-10 19:15:27 -05:00
ksmbd_work.h cifsd: remove unneeded macros 2021-05-10 19:15:27 -05:00
Makefile cifsd: add Kconfig and Makefile 2021-05-10 19:15:16 -05:00
misc.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
misc.h cifsd: Pass string length parameter to match_pattern() 2021-05-10 19:15:24 -05:00
ndr.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
ndr.h
netmisc.c cifsd: merge time_wrappers.h into smb_common.h 2021-05-10 19:15:30 -05:00
nterr.c
nterr.h
ntlmssp.h
oplock.c cifsd: fix wrong prototype in comment 2021-05-10 19:15:30 -05:00
oplock.h cifsd: remove stale prototype and variables 2021-05-10 19:15:35 -05:00
server.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
server.h cifsd: remove stale prototype and variables 2021-05-10 19:15:35 -05:00
smb2misc.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
smb2ops.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
smb2pdu.c cifsd: use xarray instead of linked list for tree connect list 2021-05-10 19:15:34 -05:00
smb2pdu.h cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
smb_common.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
smb_common.h cifsd: merge time_wrappers.h into smb_common.h 2021-05-10 19:15:30 -05:00
smbacl.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
smbacl.h cifsd: remove stale prototype and variables 2021-05-10 19:15:35 -05:00
smberr.h
smbfsctl.h
smbstatus.h
transport_ipc.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
transport_ipc.h cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
transport_rdma.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
transport_rdma.h
transport_tcp.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
transport_tcp.h
unicode.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
unicode.h cifsd: remove stale prototype and variables 2021-05-10 19:15:35 -05:00
uniupr.h
vfs_cache.c cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
vfs_cache.h cifsd: clean-up codes using chechpatch.pl --strict 2021-05-10 19:15:29 -05:00
vfs.c cifsd: remove useless error handling in ksmbd_vfs_read 2021-05-10 19:15:34 -05:00
vfs.h cifsd: remove stale prototype and variables 2021-05-10 19:15:35 -05:00