Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9e3f1a15
Commit
9e3f1a15
authored
Jun 06, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Jun 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineusb: Fix memory leaks on error paths in usb_submit_urb (scan-build).
parent
dcb123fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
unixlib.c
dlls/wineusb.sys/unixlib.c
+12
-0
No files found.
dlls/wineusb.sys/unixlib.c
View file @
9e3f1a15
...
...
@@ -449,7 +449,10 @@ static NTSTATUS usb_submit_urb(void *args)
transfer_ctx
->
transfer_buffer
=
params
->
transfer_buffer
;
if
(
!
(
transfer
=
libusb_alloc_transfer
(
0
)))
{
free
(
transfer_ctx
);
return
STATUS_NO_MEMORY
;
}
irp
->
Tail
.
Overlay
.
DriverContext
[
0
]
=
transfer
;
if
(
pipe
.
type
==
UsbdPipeTypeBulk
)
...
...
@@ -465,6 +468,7 @@ static NTSTATUS usb_submit_urb(void *args)
else
{
WARN
(
"Invalid pipe type %#x.
\n
"
,
pipe
.
type
);
free
(
transfer_ctx
);
libusb_free_transfer
(
transfer
);
return
USBD_STATUS_INVALID_PIPE_HANDLE
;
}
...
...
@@ -489,11 +493,15 @@ static NTSTATUS usb_submit_urb(void *args)
transfer_ctx
->
transfer_buffer
=
params
->
transfer_buffer
;
if
(
!
(
transfer
=
libusb_alloc_transfer
(
0
)))
{
free
(
transfer_ctx
);
return
STATUS_NO_MEMORY
;
}
irp
->
Tail
.
Overlay
.
DriverContext
[
0
]
=
transfer
;
if
(
!
(
buffer
=
malloc
(
sizeof
(
struct
libusb_control_setup
)
+
req
->
TransferBufferLength
)))
{
free
(
transfer_ctx
);
libusb_free_transfer
(
transfer
);
return
STATUS_NO_MEMORY
;
}
...
...
@@ -549,11 +557,15 @@ static NTSTATUS usb_submit_urb(void *args)
FIXME
(
"Unhandled flags %#x.
\n
"
,
(
int
)
req
->
TransferFlags
);
if
(
!
(
transfer
=
libusb_alloc_transfer
(
0
)))
{
free
(
transfer_ctx
);
return
STATUS_NO_MEMORY
;
}
irp
->
Tail
.
Overlay
.
DriverContext
[
0
]
=
transfer
;
if
(
!
(
buffer
=
malloc
(
sizeof
(
struct
libusb_control_setup
)
+
req
->
TransferBufferLength
)))
{
free
(
transfer_ctx
);
libusb_free_transfer
(
transfer
);
return
STATUS_NO_MEMORY
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment