mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-20 15:43:16 +00:00
Check that xfer != NULL before dereferencing it, not after.
Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor)
This commit is contained in:
parent
bff4678e78
commit
a333b323e1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126102
@ -973,10 +973,10 @@ fw_xfer_alloc_buf(struct malloc_type *type, int send_len, int recv_len)
|
||||
struct fw_xfer *xfer;
|
||||
|
||||
xfer = fw_xfer_alloc(type);
|
||||
xfer->send.pay_len = send_len;
|
||||
xfer->recv.pay_len = recv_len;
|
||||
if (xfer == NULL)
|
||||
return(NULL);
|
||||
xfer->send.pay_len = send_len;
|
||||
xfer->recv.pay_len = recv_len;
|
||||
if (send_len > 0) {
|
||||
xfer->send.payload = malloc(send_len, type, M_NOWAIT | M_ZERO);
|
||||
if (xfer->send.payload == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user