Don't free memory that has been freed already.
Null the pointer after freeing the memory. PR: 27370 Submitted by: Alec Barea <alec@barea.org> MFC after: 5 days
This commit is contained in:
parent
e8eb8a31d4
commit
d5adc4c167
@ -230,8 +230,6 @@ USB_ATTACH(uhid)
|
||||
if (err) {
|
||||
printf("%s: no report descriptor\n", USBDEVNAME(sc->sc_dev));
|
||||
sc->sc_dying = 1;
|
||||
if (desc != NULL)
|
||||
free(desc, M_USBDEV);
|
||||
USB_ATTACH_ERROR_RETURN;
|
||||
}
|
||||
|
||||
|
@ -460,6 +460,7 @@ usbd_alloc_report_desc(ifc, descp, sizep, mem)
|
||||
*sizep, *descp);
|
||||
if (err) {
|
||||
free(*descp, mem);
|
||||
*descp = NULL;
|
||||
return (err);
|
||||
}
|
||||
return (USBD_NORMAL_COMPLETION);
|
||||
|
Loading…
Reference in New Issue
Block a user