summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2017-08-24 04:06:06 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2017-08-24 04:06:06 +0000
commit5ad00a978ca8947a12be9a9b10b044f36194399d (patch)
treee925042b7a4b3b8352f08cbc654f6365e91a21d2 /sys/dev
parent0284e39589dc1e85ba2739c78ca983c14535008c (diff)
Fix a memory leak in an error path. Coverity CID 1453101.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pcmcia/pcmcia_cis_quirks.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pcmcia/pcmcia_cis_quirks.c b/sys/dev/pcmcia/pcmcia_cis_quirks.c
index 901dbbec67e..62f8535a39d 100644
--- a/sys/dev/pcmcia/pcmcia_cis_quirks.c
+++ b/sys/dev/pcmcia/pcmcia_cis_quirks.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcmcia_cis_quirks.c,v 1.12 2015/03/14 03:38:49 jsg Exp $ */
+/* $OpenBSD: pcmcia_cis_quirks.c,v 1.13 2017/08/24 04:06:05 jsg Exp $ */
/* $NetBSD: pcmcia_cis_quirks.c,v 1.3 1998/12/29 09:00:28 marc Exp $ */
/*
@@ -276,8 +276,10 @@ void pcmcia_check_cis_quirks(sc)
SIMPLEQ_INIT(&pf->cfe_head);
cfe = malloc(sizeof(*cfe), M_DEVBUF, M_NOWAIT);
- if (cfe == NULL)
+ if (cfe == NULL) {
+ free(pf, M_DEVBUF, sizeof(*pf));
return;
+ }
*cfe = *pcmcia_cis_quirks[i].cfe;
SIMPLEQ_INSERT_TAIL(&pf->cfe_head, cfe, cfe_list);