mirror of
https://github.com/torvalds/linux.git
synced 2024-12-31 23:31:29 +00:00
cifs: free nativeFileSystem field before allocating a new one
...otherwise, we'll leak this memory if we have to reconnect (e.g. after network failure). Signed-off-by: Jeff Layton <jlayton@redhat.com> CC: Stable <stable@kernel.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
This commit is contained in:
parent
287638b2c5
commit
90a98b2f3f
@ -2726,6 +2726,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
|
||||
strncpy(tcon->treeName, tree, MAX_TREE_SIZE);
|
||||
|
||||
/* mostly informational -- no need to fail on error here */
|
||||
kfree(tcon->nativeFileSystem);
|
||||
tcon->nativeFileSystem = cifs_strndup_from_ucs(bcc_ptr,
|
||||
bytes_left, is_unicode,
|
||||
nls_codepage);
|
||||
|
Loading…
Reference in New Issue
Block a user