summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-06-21 00:15:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-06-21 00:15:13 +0000
commitb8a006201d7f6e48eb06ef69042f09a1e6caddc9 (patch)
tree55818fe1c802a7dbdb685f7bea433ee8f98e2070
parentfd2b6ce7de8b41994829852668364c82d5d8fa6a (diff)
memory leak on failure; from Maxime Villard
-rw-r--r--sys/dev/ipmi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c
index 012d081c2de..6ae8cbfc544 100644
--- a/sys/dev/ipmi.c
+++ b/sys/dev/ipmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmi.c,v 1.75 2015/01/07 07:49:18 yasuoka Exp $ */
+/* $OpenBSD: ipmi.c,v 1.76 2015/06/21 00:15:12 deraadt Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave
@@ -1050,8 +1050,10 @@ ipmi_recvcmd(struct ipmi_softc *sc, int maxlen, int *rxlen, void *data)
}
/* Receive message from interface, copy out result data */
if (sc->sc_if->recvmsg(sc, maxlen + 3, &rawlen, buf) ||
- rawlen < IPMI_MSG_DATARCV)
+ rawlen < IPMI_MSG_DATARCV) {
+ free(buf, M_DEVBUF, 0);
return (-1);
+ }
*rxlen = rawlen - IPMI_MSG_DATARCV;
if (*rxlen > 0 && data)