diff options
| author | christos <christos@NetBSD.org> | 2015-11-10 18:11:05 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2015-11-10 18:11:05 +0000 |
| commit | 02c63fb613ab6d2fe4159389aeca5b59de9e4e02 (patch) | |
| tree | 532cd302b2b08e436b0924e973baca81f5cd3fdb /lib | |
| parent | 4f5c3746c22c3d7830dedcca57ed87ba5fd1351c (diff) | |
CID 1338520: Check NULL
CID 1338521: Fix error (realloc returns different pointer)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/rpc/svc_fdset.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libc/rpc/svc_fdset.c b/lib/libc/rpc/svc_fdset.c index 8a51e074ec2..99ac2d5c055 100644 --- a/lib/libc/rpc/svc_fdset.c +++ b/lib/libc/rpc/svc_fdset.c @@ -1,4 +1,4 @@ -/* $NetBSD: svc_fdset.c,v 1.13 2015/11/10 18:08:05 christos Exp $ */ +/* $NetBSD: svc_fdset.c,v 1.14 2015/11/10 18:11:05 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: svc_fdset.c,v 1.13 2015/11/10 18:08:05 christos Exp $"); +__RCSID("$NetBSD: svc_fdset.c,v 1.14 2015/11/10 18:11:05 christos Exp $"); #include "reentrant.h" @@ -215,6 +215,7 @@ svc_pollfd_add(int fd, struct svc_fdset *fds) fds->fdused = fds->fdnum + 1; DPRINTF("add fd=%d slot=%d fdused=%d", fd, fds->fdnum, fds->fdused); fds->fdnum += FD_SETSIZE; + fds->fdp = pfd; return fds; } @@ -323,6 +324,8 @@ svc_fdset_zero(void) DPRINTF("zero"); struct svc_fdset *fds = svc_fdset_alloc(0); + if (fds == NULL) + return; memset(fds->fdset, 0, fds->fdsize); fds->fdmax = -1; |
