msg.msg_controllen = CMSG_LEN(sizeof_fds);
cmptr = CMSG_FIRSTHDR(&msg);
+ if (!cmptr) {
+ return -1;
+ }
cmptr->cmsg_level = SOL_SOCKET;
cmptr->cmsg_type = SCM_RIGHTS;
cmptr->cmsg_len = CMSG_LEN(sizeof_fds);
msg.msg_controllen = CMSG_LEN(sizeof_cred);
cmptr = CMSG_FIRSTHDR(&msg);
+ if (!cmptr) {
+ return -1;
+ }
cmptr->cmsg_level = SOL_SOCKET;
cmptr->cmsg_type = LTTNG_SOCK_CREDS;
cmptr->cmsg_len = CMSG_LEN(sizeof_cred);
struct filter_node *old_child,
struct filter_node *new_child)
{
+ if (!parent) {
+ fprintf(stderr, "[error] %s: NULL parent\n", __func__);
+ return -EINVAL;
+ }
+
switch (parent->type) {
case NODE_UNKNOWN:
default: