#include <strings.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <stdint.h>
#include "../lib/sstring.h"
#include "../lib/irc_string.h"
if(bind(fd, (struct sockaddr *) &sin, sizeof(sin))) {
nterface_log(nrl, NL_ERROR, "Unable to bind listen socket (%d).", errno);
+ close(fd);
return -1;
}
if(ioctl(fd, FIONBIO, &opt)) {
nterface_log(nrl, NL_ERROR, "Unable to set listen socket non-blocking.");
+ close(fd);
return -1;
}
if(ioctl(newfd, FIONBIO, &opt)) {
nterface_log(nrl, NL_ERROR, "Unable to set accepted socket non-blocking.");
+ close(newfd);
return;
}
if(*p == ',')
break;
- if(!*p || !(p + 1))
+ if(!*p || !*(p + 1))
return RE_BAD_LINE;
*p = '\0';
*number = positive_atoi(sp + 1);
- if((*number < 1) || (*number > 0xffff))
+ if((*number < 1) || (*number > INT32_MAX))
return RE_BAD_LINE;
if (!service) {