diff mbox series

[11/13] rtime.c: resource_leak

Message ID 20180907180151.178872-12-steved@redhat.com (mailing list archive)
State New, archived
Headers show
Series libtirpc: Closed a number of memory leaks | expand

Commit Message

Steve Dickson Sept. 7, 2018, 6:01 p.m. UTC
Handle variable "s" going out of scope leaks the handle.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 src/rtime.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/src/rtime.c b/src/rtime.c
index b642840..29fbf0a 100644
--- a/src/rtime.c
+++ b/src/rtime.c
@@ -90,6 +90,7 @@  rtime(addrp, timep, timeout)
 
 	/* TCP and UDP port are the same in this case */
 	if ((serv = getservbyname("time", "tcp")) == NULL) {
+		do_close(s);
 		return(-1);
 	}