diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2001-06-30 10:57:37 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2001-06-30 10:57:37 +0000 |
commit | d5adc4c167f19e7905710cbdcc93a8489521d1c4 (patch) | |
tree | fbf33a7213457a43cc8f13d217e4253e53563b69 /sys | |
parent | e8eb8a31d4de26acf6bbdc811ed75782d01f80b4 (diff) | |
download | FreeBSD-src-d5adc4c167f19e7905710cbdcc93a8489521d1c4.zip FreeBSD-src-d5adc4c167f19e7905710cbdcc93a8489521d1c4.tar.gz |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/uhid.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/usbdi_util.c | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 869e94e..f233e17 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -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; } diff --git a/sys/dev/usb/usbdi_util.c b/sys/dev/usb/usbdi_util.c index ff48fd7..3c5b104 100644 --- a/sys/dev/usb/usbdi_util.c +++ b/sys/dev/usb/usbdi_util.c @@ -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); |