summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2004-09-27 17:28:04 +0000
committerJason Wright <jason@cvs.openbsd.org>2004-09-27 17:28:04 +0000
commit83dfef72c076af993a379b674041e30dcc3fa52d (patch)
tree94a12082cb54a1bb9b8927a1c38ac3be98bcea8b /sys/arch/sparc64
parent26ed3e668bfa51ca1ce3eaff89f2306a4167c578 (diff)
check malloc return correctly; from Patrick Latifi
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/dev/central.c4
-rw-r--r--sys/arch/sparc64/dev/fhc.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/sparc64/dev/central.c b/sys/arch/sparc64/dev/central.c
index ff0df84ad10..896d578b010 100644
--- a/sys/arch/sparc64/dev/central.c
+++ b/sys/arch/sparc64/dev/central.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: central.c,v 1.3 2004/09/24 20:49:57 jason Exp $ */
+/* $OpenBSD: central.c,v 1.4 2004/09/27 17:28:03 jason Exp $ */
/*
* Copyright (c) 2004 Jason L. Wright (jason@thought.net)
@@ -121,7 +121,7 @@ central_get_string(int node, char *name, char **buf)
if (len < 0)
return (len);
*buf = (char *)malloc(len + 1, M_DEVBUF, M_NOWAIT);
- if (buf == NULL)
+ if (*buf == NULL)
return (-1);
if (len != 0)
diff --git a/sys/arch/sparc64/dev/fhc.c b/sys/arch/sparc64/dev/fhc.c
index 96e909e5e7f..b596d2f31c2 100644
--- a/sys/arch/sparc64/dev/fhc.c
+++ b/sys/arch/sparc64/dev/fhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fhc.c,v 1.4 2004/09/24 21:29:36 jason Exp $ */
+/* $OpenBSD: fhc.c,v 1.5 2004/09/27 17:28:03 jason Exp $ */
/*
* Copyright (c) 2004 Jason L. Wright (jason@thought.net)
@@ -123,7 +123,7 @@ fhc_get_string(int node, char *name, char **buf)
if (len < 0)
return (len);
*buf = (char *)malloc(len + 1, M_DEVBUF, M_NOWAIT);
- if (buf == NULL)
+ if (*buf == NULL)
return (-1);
if (len != 0)