[4.0] d9cc0a7 Fix a improbable memory leak.

Poul-Henning Kamp phk at FreeBSD.org
Thu Mar 13 10:24:21 CET 2014


commit d9cc0a700b9777b2a8ea192df1063c33e59caef5
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Jan 23 22:23:26 2014 +0000

    Fix a improbable memory leak.

diff --git a/bin/varnishd/mgt/mgt_param_tcp.c b/bin/varnishd/mgt/mgt_param_tcp.c
index 5ef6b94..8f107e3 100644
--- a/bin/varnishd/mgt/mgt_param_tcp.c
+++ b/bin/varnishd/mgt/mgt_param_tcp.c
@@ -106,13 +106,12 @@ tcp_keep_probes(void)
 		return;		// XXX: log
 	assert (i > 0);
 	s = VSS_listen(ta[0], 10);
-	if (s < 0)
-		return;		// XXX: log
-
-	tcp_probe(s, TCP_KEEPIDLE, "tcp_keepalive_time",	600);
-	tcp_probe(s, TCP_KEEPCNT, "tcp_keepalive_probes",	5);
-	tcp_probe(s, TCP_KEEPINTVL, "tcp_keepalive_intvl",	5);
-	AZ(close(s));
+	if (s >= 0) {
+		tcp_probe(s, TCP_KEEPIDLE, "tcp_keepalive_time",	600);
+		tcp_probe(s, TCP_KEEPCNT, "tcp_keepalive_probes",	5);
+		tcp_probe(s, TCP_KEEPINTVL, "tcp_keepalive_intvl",	5);
+		AZ(close(s));
+	}
 	free(ta);
 }
 #endif



More information about the varnish-commit mailing list