Fix memory leak of devinfop

PR: 108719
Submitted by: Antoine Brodin
This commit is contained in:
Warner Losh 2007-02-03 16:41:55 +00:00
parent f254d5b0d1
commit 5f1413947b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166472

View File

@ -277,10 +277,8 @@ USB_ATTACH(uvisor)
devinfo = malloc(1024, M_USBDEV, M_WAITOK);
ucom = &sc->sc_ucom;
bzero(sc, sizeof (struct uvisor_softc));
usbd_devinfo(dev, 0, devinfo);
ucom->sc_dev = self;
device_set_desc_copy(self, devinfo);
@ -289,6 +287,7 @@ USB_ATTACH(uvisor)
devname = device_get_nameunit(ucom->sc_dev);
printf("%s: %s\n", devname, devinfo);
free(devinfo, M_USBDEV);
DPRINTFN(10,("\nuvisor_attach: sc=%p\n", sc));