From: Jinoh Kang jinoh.kang.kr@gmail.com
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com --- dlls/wineusb.sys/wineusb.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/wineusb.sys/wineusb.c b/dlls/wineusb.sys/wineusb.c index 0b8af43a3dc..e1ec7d3d9bc 100644 --- a/dlls/wineusb.sys/wineusb.c +++ b/dlls/wineusb.sys/wineusb.c @@ -824,6 +824,11 @@ static void LIBUSB_CALL transfer_cb(struct libusb_transfer *transfer) } }
+ if (urb->UrbHeader.Function != URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER) + { + free(transfer->buffer); + } + event.type = USB_EVENT_TRANSFER_COMPLETE; event.u.completed_irp = irp; queue_event(&event);
On 7/9/22 11:10, Jinoh Kang wrote:
From: Jinoh Kang jinoh.kang.kr@gmail.com
Signed-off-by: Jinoh Kang jinoh.kang.kr@gmail.com
dlls/wineusb.sys/wineusb.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/wineusb.sys/wineusb.c b/dlls/wineusb.sys/wineusb.c index 0b8af43a3dc..e1ec7d3d9bc 100644 --- a/dlls/wineusb.sys/wineusb.c +++ b/dlls/wineusb.sys/wineusb.c @@ -824,6 +824,11 @@ static void LIBUSB_CALL transfer_cb(struct libusb_transfer *transfer) } }
- if (urb->UrbHeader.Function != URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER)
- {
free(transfer->buffer);
- }
event.type = USB_EVENT_TRANSFER_COMPLETE; event.u.completed_irp = irp; queue_event(&event);
We use LIBUSB_TRANSFER_FREE_TRANSFER for these cases.
On Sat Jul 9 16:48:25 2022 +0000, **** wrote:
Zebediah Figura replied on the mailing list:
On 7/9/22 11:10, Jinoh Kang wrote: > From: Jinoh Kang <jinoh.kang.kr@gmail.com> > > Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com> > --- > dlls/wineusb.sys/wineusb.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/dlls/wineusb.sys/wineusb.c b/dlls/wineusb.sys/wineusb.c > index 0b8af43a3dc..e1ec7d3d9bc 100644 > --- a/dlls/wineusb.sys/wineusb.c > +++ b/dlls/wineusb.sys/wineusb.c > @@ -824,6 +824,11 @@ static void LIBUSB_CALL transfer_cb(struct libusb_transfer *transfer) > } > } > > + if (urb->UrbHeader.Function != URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER) > + { > + free(transfer->buffer); > + } > + > event.type = USB_EVENT_TRANSFER_COMPLETE; > event.u.completed_irp = irp; > queue_event(&event); We use LIBUSB_TRANSFER_FREE_TRANSFER for these cases. _______________________________________________ wine-gitlab mailing list -- wine-gitlab@winehq.org To unsubscribe send an email to wine-gitlab-leave@winehq.org
I never imagined that a library would hard-code the choice of memory management function on a user-supplied buffer. Sorry for the noise.
On 7/9/22 12:38, Jinoh Kang (@iamahuman) wrote:
On Sat Jul 9 16:48:25 2022 +0000, **** wrote:
Zebediah Figura replied on the mailing list:
On 7/9/22 11:10, Jinoh Kang wrote: > From: Jinoh Kang <jinoh.kang.kr@gmail.com> > > Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com> > --- > dlls/wineusb.sys/wineusb.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/dlls/wineusb.sys/wineusb.c b/dlls/wineusb.sys/wineusb.c > index 0b8af43a3dc..e1ec7d3d9bc 100644 > --- a/dlls/wineusb.sys/wineusb.c > +++ b/dlls/wineusb.sys/wineusb.c > @@ -824,6 +824,11 @@ static void LIBUSB_CALL transfer_cb(struct libusb_transfer *transfer) > } > } > > + if (urb->UrbHeader.Function != URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER) > + { > + free(transfer->buffer); > + } > + > event.type = USB_EVENT_TRANSFER_COMPLETE; > event.u.completed_irp = irp; > queue_event(&event); We use LIBUSB_TRANSFER_FREE_TRANSFER for these cases. _______________________________________________ wine-gitlab mailing list -- wine-gitlab@winehq.org To unsubscribe send an email to wine-gitlab-leave@winehq.org
I never imagined that a library would hard-code the choice of memory management function on a user-supplied buffer. Sorry for the noise.
Well, I'd hardly call it hard-coded; you're free to omit the flag if you want to use a different free function. It's just a convenience.
This merge request was closed by Jinoh Kang.