Hi,

This one might not find this way as it might then having a performance hit,
I was outweighting the outcome for this patch myself ... We ll see.

Regards.
From f8713e332f99aee682ef12c7bbbc39766be3d3ff Mon Sep 17 00:00:00 2001
From: David Carlier <dcarl...@afilias.info>
Date: Fri, 8 Apr 2016 10:44:08 +0100
Subject: [PATCH 4/4] CLEANUP: proto_uxst: initialize socket before setting.

Initializes the socket before usage. However, there might
be then a slight impact performance hit.
---
 src/proto_uxst.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index b2a7fe2..3fa9504 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -131,6 +131,7 @@ static void destroy_uxst_socket(const char *path)
 	if (sock < 0)
 		return;
 
+	memset(&addr, 0, sizeof(addr));
 	addr.sun_family = AF_UNIX;
 	strncpy(addr.sun_path, path, sizeof(addr.sun_path));
 	addr.sun_path[sizeof(addr.sun_path) - 1] = 0;
@@ -191,6 +192,7 @@ static int uxst_bind_listener(struct listener *listener, char *errmsg, int errle
 	if (ext)
 		goto fd_ready;
 
+	memset(&addr, 0, sizeof(addr));
 	if (path[0]) {
 		ret = snprintf(tempname, MAXPATHLEN, "%s.%d.tmp", path, pid);
 		if (ret < 0 || ret >= MAXPATHLEN) {
-- 
2.5.0

Reply via email to