summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/clients/yp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/clients/yp.c b/tests/clients/yp.c
index 6ef15ec..200d591 100644
--- a/tests/clients/yp.c
+++ b/tests/clients/yp.c
@@ -184,6 +184,7 @@ all(CLIENT *client, FILE *output, int argc, char **argv)
}
if (connect(sock, (struct sockaddr *) &server, sizeof(server)) != 0) {
fprintf(stderr, "error setting up RPC client\n");
+ close(sock);
return 1;
}
@@ -205,10 +206,12 @@ all(CLIENT *client, FILE *output, int argc, char **argv)
if (!xdr_callmsg(&s, &req)) {
fprintf(stderr, "error setting up RPC client\n");
+ close(sock);
return 1;
}
if (!xdr_ypreq_nokey(&s, &nokey)) {
fprintf(stderr, "error setting up RPC client\n");
+ close(sock);
return 1;
}
xdrrec_endofrecord(&s, TRUE);
@@ -245,9 +248,11 @@ all(CLIENT *client, FILE *output, int argc, char **argv)
}
}
xdr_destroy(&s);
+ close(sock);
return 0;
} else {
xdr_destroy(&s);
+ close(sock);
return 1;
}
}