nl_recv(): Make passing creds pointer optional
This commit is contained in:
parent
e52a09c507
commit
9fbdf6c92a
1 changed files with 4 additions and 2 deletions
6
lib/nl.c
6
lib/nl.c
|
@ -485,8 +485,10 @@ retry:
|
|||
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
|
||||
if (cmsg->cmsg_level == SOL_SOCKET &&
|
||||
cmsg->cmsg_type == SCM_CREDENTIALS) {
|
||||
*creds = calloc(1, sizeof(struct ucred));
|
||||
memcpy(*creds, CMSG_DATA(cmsg), sizeof(struct ucred));
|
||||
if (creds) {
|
||||
*creds = calloc(1, sizeof(struct ucred));
|
||||
memcpy(*creds, CMSG_DATA(cmsg), sizeof(struct ucred));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue