Skip to content

Commit 5fd0a1d

Browse files
committed
Merge tag 'v6.19rc8-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fixes from Steve French: "Two small client memory leak fixes" * tag 'v6.19rc8-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb/client: fix memory leak in SendReceive() smb/client: fix memory leak in smb2_open_file()
2 parents de0674d + 67b3da8 commit 5fd0a1d

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

fs/smb/client/cifstransport.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,15 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
251251
rc = cifs_send_recv(xid, ses, ses->server,
252252
&rqst, &resp_buf_type, flags, &resp_iov);
253253
if (rc < 0)
254-
return rc;
254+
goto out;
255255

256256
if (out_buf) {
257257
*pbytes_returned = resp_iov.iov_len;
258258
if (resp_iov.iov_len)
259259
memcpy(out_buf, resp_iov.iov_base, resp_iov.iov_len);
260260
}
261+
262+
out:
261263
free_rsp_buf(resp_buf_type, resp_iov.iov_base);
262264
return rc;
263265
}

fs/smb/client/smb2file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ int smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms,
178178
rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL, &err_iov,
179179
&err_buftype);
180180
if (rc == -EACCES && retry_without_read_attributes) {
181+
free_rsp_buf(err_buftype, err_iov.iov_base);
181182
oparms->desired_access &= ~FILE_READ_ATTRIBUTES;
182183
rc = SMB2_open(xid, oparms, smb2_path, &smb2_oplock, smb2_data, NULL, &err_iov,
183184
&err_buftype);

0 commit comments

Comments
 (0)