Free allocated memory if attach fails.

From Coverity CID 2329
This commit is contained in:
david 2006-03-19 22:30:56 +00:00
parent 8e4130e5ee
commit f68eabdfe8
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_axe.c,v 1.12 2005/11/28 13:31:09 augustss Exp $ */
/* $NetBSD: if_axe.c,v 1.13 2006/03/19 22:30:56 david Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000-2003
@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.12 2005/11/28 13:31:09 augustss Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.13 2006/03/19 22:30:56 david Exp $");
#if defined(__NetBSD__)
#include "opt_inet.h"
@ -465,6 +465,7 @@ USB_ATTACH(axe)
if (err) {
printf("%s: getting interface handle failed\n",
USBDEVNAME(sc->axe_dev));
usbd_devinfo_free(devinfop);
USB_ATTACH_ERROR_RETURN;
}
@ -476,6 +477,7 @@ USB_ATTACH(axe)
if (err) {
printf("%s: getting interface handle failed\n",
USBDEVNAME(sc->axe_dev));
usbd_devinfo_free(devinfop);
USB_ATTACH_ERROR_RETURN;
}