diff options
author | 2004-09-27 17:28:03 +0000 | |
---|---|---|
committer | 2004-09-27 17:28:03 +0000 | |
commit | f1cc154a2ff2b0ac817f186fed6930b3652228a9 (patch) | |
tree | a75e41de2065f10eacebaf648a4ca90385b8fe81 | |
parent | cvsd_recvmsg() is supposed to return 1 when a message has been read. (diff) | |
download | wireguard-openbsd-f1cc154a2ff2b0ac817f186fed6930b3652228a9.tar.xz wireguard-openbsd-f1cc154a2ff2b0ac817f186fed6930b3652228a9.zip |
check malloc return correctly; from Patrick Latifi
-rw-r--r-- | sys/arch/sparc64/dev/central.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/fhc.c | 4 |
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) |