diff options
-rw-r--r-- | src/portmap.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/portmap.c b/src/portmap.c index b756247..ea2a05f 100644 --- a/src/portmap.c +++ b/src/portmap.c @@ -78,6 +78,10 @@ main(int argc, char **argv) { int s, ret, port; s = socket(PF_INET, SOCK_DGRAM, 0); + if (s == -1) { + printf("error allocating socket\n"); + return 1; + } if ((port = portmap_bind_resvport(s, AF_INET, 0)) < 0) { printf("error binding to reserved port, using 541\n"); port = 541; /* arbitrary */ |