summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatteo <matteo@FreeBSD.org>2007-11-07 10:21:36 +0000
committermatteo <matteo@FreeBSD.org>2007-11-07 10:21:36 +0000
commit350f518402f17e189d71fde9dc889b50554369e6 (patch)
tree588f5e2b8f370f6bd3ae376658908e1166d2a29a
parent5b9f78454d3bcd0a6b0e5243b3d6801eea239f4a (diff)
downloadFreeBSD-src-350f518402f17e189d71fde9dc889b50554369e6.zip
FreeBSD-src-350f518402f17e189d71fde9dc889b50554369e6.tar.gz
Check the correct variables for malloc failures.
Submitted by: Michiel Boland <michiel@boland.org>
-rw-r--r--usr.sbin/rpc.lockd/lockd.c2
-rw-r--r--usr.sbin/rpc.statd/statd.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c
index 6c2e2c7..99081d4 100644
--- a/usr.sbin/rpc.lockd/lockd.c
+++ b/usr.sbin/rpc.lockd/lockd.c
@@ -388,7 +388,7 @@ create_service(struct netconfig *nconf)
break;
case AF_INET6:
sin6 = malloc(sizeof(struct sockaddr_in6));
- if (res->ai_addr == NULL)
+ if (sin6 == NULL)
out_of_mem();
sin6->sin6_family = AF_INET6;
sin6->sin6_port = htons(0);
diff --git a/usr.sbin/rpc.statd/statd.c b/usr.sbin/rpc.statd/statd.c
index 3b6d010..c942338 100644
--- a/usr.sbin/rpc.statd/statd.c
+++ b/usr.sbin/rpc.statd/statd.c
@@ -330,7 +330,7 @@ create_service(struct netconfig *nconf)
break;
case AF_INET6:
sin6 = malloc(sizeof(struct sockaddr_in6));
- if (res->ai_addr == NULL)
+ if (sin6 == NULL)
out_of_mem();
sin6->sin6_family = AF_INET6;
sin6->sin6_port = htons(0);
OpenPOWER on IntegriCloud