usb/140325: Missing/incorrect initialisation and memory leak in
libusb10/libusb20
Robert Jenssen
robertjenssen at hotmail.com
Fri Nov 6 04:10:05 UTC 2009
The following reply was made to PR usb/140325; it has been noted by GNATS.
From: Robert Jenssen <robertjenssen at hotmail.com>
To: <bug-followup at freebsd.org>
Cc:
Subject: Re: usb/140325: Missing/incorrect initialisation and memory leak in
libusb10/libusb20
Date: Fri, 6 Nov 2009 14:57:00 +1100
--_813ea73d-cf99-4614-b03d-4bb9d22d7898_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi=2C
Sorry for the noise. In my last email I missed out a memory leak:
6. In libusb10.c=2C libusb_close()=2C pdev isn't freed. Here is a diff:
*** libusb10.c 2009-11-06 13:30:51.000000000 +1100
--- libusb10.c.orig 2009-08-03 18:13:06.000000000 +1000
***************
*** 416=2C422 ****
libusb10_remove_pollfd(ctx=2C &dev->dev_poll)=3B
=20
libusb20_dev_close(pdev)=3B
- free(pdev)=3B
libusb_unref_device(dev)=3B
=20
/* make sure our event loop detects the closed device */
--- 416=2C421 ----
--=20
Robert Jenssen <robertjenssen at hotmail.com>
=20
_________________________________________________________________
Looking to move this spring? With all the lastest places=2C searching has n=
ever been easier. Look now!
http://clk.atdmt.com/NMN/go/157631292/direct/01/=
--_813ea73d-cf99-4614-b03d-4bb9d22d7898_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 10pt=3B
font-family:Verdana
}
--></style>
</head>
<body class=3D'hmmessage'>
Hi=2C<br><br>Sorry for the noise. In my last email I missed out a memory le=
ak:<br><br>6. In libusb10.c=2C libusb_close()=2C pdev isn't freed. Here is =
a diff:<br>*** libusb10.c =3B =3B  =3B2009-11-06 13:30:51.00000=
0000 +1100<br>--- libusb10.c.orig =3B =3B  =3B2009-08-03 18:13:=
06.000000000 +1000<br>***************<br>*** 416=2C422 ****<br> =3B &nb=
sp=3B =3B  =3Blibusb10_remove_pollfd(ctx=2C &=3Bdev->=3Bdev_po=
ll)=3B<br> =3B <br> =3B  =3B =3B  =3Blibusb20_dev_close=
(pdev)=3B<br>- =3B =3B free(pdev)=3B<br> =3B  =3B =3B &=
nbsp=3Blibusb_unref_device(dev)=3B<br> =3B <br> =3B  =3B =
=3B  =3B/* make sure our event loop detects the closed device */<br>---=
416=2C421 ----<br><br>-- <br>Robert Jenssen <=3Brobertjenssen at hotmail.co=
m>=3B<br><br> <br /><hr />With all the lastest places=2C searc=
hing has never been easier. Look now! <a href=3D'http://clk.atdmt.com/NMN/g=
o/157631292/direct/01/' target=3D'_new'>Looking to move this spring?</a></b=
ody>
</html>=
--_813ea73d-cf99-4614-b03d-4bb9d22d7898_--
More information about the freebsd-usb
mailing list