summaryrefslogtreecommitdiff
path: root/sys/dev/ic/mfi.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2013-05-08 03:00:33 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2013-05-08 03:00:33 +0000
commit2b4af606deb1d64d5908414e79a95bdb95ad2e17 (patch)
tree0011a2fe115266120ab7ad0cdfa338c91e770b74 /sys/dev/ic/mfi.c
parentc32f4412e411ca726c9da2cab9fbc08d35ad7669 (diff)
fix some leaks in error paths
ok fgsch@ krw@ kettenis@
Diffstat (limited to 'sys/dev/ic/mfi.c')
-rw-r--r--sys/dev/ic/mfi.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index f4da5f89fbd..25f47df0d8e 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.144 2013/05/03 02:46:28 dlg Exp $ */
+/* $OpenBSD: mfi.c,v 1.145 2013/05/08 03:00:32 jsg Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -1470,8 +1470,10 @@ mfi_bio_getitall(struct mfi_softc *sc)
if (cfg == NULL)
goto done;
if (mfi_mgmt(sc, MR_DCMD_CONF_GET, MFI_DATA_IN, sizeof *cfg, cfg,
- NULL))
+ NULL)) {
+ free(cfg, M_DEVBUF);
goto done;
+ }
size = cfg->mfc_size;
free(cfg, M_DEVBUF);
@@ -1480,8 +1482,10 @@ mfi_bio_getitall(struct mfi_softc *sc)
cfg = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO);
if (cfg == NULL)
goto done;
- if (mfi_mgmt(sc, MR_DCMD_CONF_GET, MFI_DATA_IN, size, cfg, NULL))
+ if (mfi_mgmt(sc, MR_DCMD_CONF_GET, MFI_DATA_IN, size, cfg, NULL)) {
+ free(cfg, M_DEVBUF);
goto done;
+ }
/* replace current pointer with enw one */
if (sc->sc_cfg)