Browse Source

* source/portknock : fix fd leakage

master
Alex 'AdUser' Z 4 years ago
parent
commit
260648ee2a
  1. 1
      src/sources/portknock.c

1
src/sources/portknock.c

@ -188,6 +188,7 @@ next(cfg_t *cfg, char *buf, size_t bufsize, bool reset) {
} }
port->accepts++; port->accepts++;
shutdown(sock, SHUT_RDWR); shutdown(sock, SHUT_RDWR);
close(sock);
if (addr.ss_family == AF_INET) { if (addr.ss_family == AF_INET) {
inet_ntop(AF_INET, &(((struct sockaddr_in *) &addr)->sin_addr), buf, bufsize); inet_ntop(AF_INET, &(((struct sockaddr_in *) &addr)->sin_addr), buf, bufsize);
return true; return true;

Loading…
Cancel
Save