MCPcopy Index your code
hub / github.com/F-Stack/f-stack / mac_socket_init

Function mac_socket_init

freebsd/security/mac/mac_socket.c:146–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146int
147mac_socket_init(struct socket *so, int flag)
148{
149
150 if (mac_labeled & MPC_OBJECT_SOCKET) {
151 so->so_label = mac_socket_label_alloc(flag);
152 if (so->so_label == NULL)
153 return (ENOMEM);
154 so->so_peerlabel = mac_socketpeer_label_alloc(flag);
155 if (so->so_peerlabel == NULL) {
156 mac_socket_label_free(so->so_label);
157 so->so_label = NULL;
158 return (ENOMEM);
159 }
160 } else {
161 so->so_label = NULL;
162 so->so_peerlabel = NULL;
163 }
164 return (0);
165}
166
167void
168mac_socket_label_free(struct label *label)

Callers 1

soallocFunction · 0.85

Calls 3

mac_socket_label_allocFunction · 0.85
mac_socket_label_freeFunction · 0.85

Tested by

no test coverage detected