Make sure all file descriptor are closed.
};
int sk, nsk;
- sk = socket(PF_ALG, SOCK_SEQPACKET, 0);
+ sk = socket(PF_ALG, SOCK_SEQPACKET | SOCK_CLOEXEC, 0);
if (sk < 0) {
perror("Failed to create socket");
return -1;
if (table->info == NULL)
goto err;
- table->ipt_sock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
+ table->ipt_sock = socket(AF_INET, SOCK_RAW | SOCK_CLOEXEC, IPPROTO_RAW);
if (table->ipt_sock < 0)
goto err;
struct ifreq ifr;
int sk, err;
- sk = socket(PF_INET, SOCK_DGRAM, 0);
+ sk = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (sk < 0)
return -errno;