diff options
author | Nalin Dahyabhai <nalin@redhat.com> | 2011-01-03 14:47:31 -0500 |
---|---|---|
committer | Nalin Dahyabhai <nalin@redhat.com> | 2011-01-03 14:47:31 -0500 |
commit | 17a1ac252f7abdc8dfafc6dbd7ed31ff9e430d16 (patch) | |
tree | 57909f3109335b304a42807054ab0e224d8f8f25 /src/portmap.c | |
parent | 22f5615834b7f06a77df2a558ba3f62edb35fefa (diff) | |
download | slapi-nis-17a1ac252f7abdc8dfafc6dbd7ed31ff9e430d16.tar.gz slapi-nis-17a1ac252f7abdc8dfafc6dbd7ed31ff9e430d16.tar.xz slapi-nis-17a1ac252f7abdc8dfafc6dbd7ed31ff9e430d16.zip |
- in main(), return an error exit status if socket() fails (defect #10101)
Diffstat (limited to 'src/portmap.c')
-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 */ |