1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-29 12:03:03 +00:00

Similar to r293704, fix theoretical leak of netconfig(3) resources in

__rpcbind_is_up(..) if getnetconfig(3) is partly successful in allocating
resources, but not completely successful by moving the endnetconfig(3) call
up before we return from the function if nconf == NULL.

MFC after: 1 week
Reported by: Coverity
Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com>
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2016-01-11 22:01:33 +00:00
parent d140ec33c7
commit 7f3159edc5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=293705

View File

@ -661,11 +661,11 @@ __rpcbind_is_up(void)
strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0)
break;
}
endnetconfig(localhandle);
if (nconf == NULL)
return (FALSE);
endnetconfig(localhandle);
memset(&sun, 0, sizeof sun);
sock = _socket(AF_LOCAL, SOCK_STREAM, 0);
if (sock < 0)