mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
cap_net: plug memory leak
MFC after: 5 days
This commit is contained in:
parent
6238905c5b
commit
88910b8b7b
|
@ -326,8 +326,10 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostname, const char *servname,
|
|||
break;
|
||||
nvlai = nvlist_get_nvlist(nvl, nvlname);
|
||||
curai = addrinfo_unpack(nvlai);
|
||||
if (curai == NULL)
|
||||
if (curai == NULL) {
|
||||
nvlist_destroy(nvl);
|
||||
return (EAI_MEMORY);
|
||||
}
|
||||
if (prevai != NULL)
|
||||
prevai->ai_next = curai;
|
||||
else
|
||||
|
@ -896,8 +898,10 @@ net_getnameinfo(const nvlist_t *limits, const nvlist_t *nvlin, nvlist_t *nvlout)
|
|||
error = EAI_FAIL;
|
||||
goto out;
|
||||
}
|
||||
if (!net_allowed_bsaddr(funclimit, sabin, sabinsize))
|
||||
return (ENOTCAPABLE);
|
||||
if (!net_allowed_bsaddr(funclimit, sabin, sabinsize)) {
|
||||
error = ENOTCAPABLE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
memcpy(&sast, sabin, sabinsize);
|
||||
salen = (socklen_t)sabinsize;
|
||||
|
|
Loading…
Reference in a new issue