From: Vsevolod Stakhov Date: Sat, 12 May 2018 14:35:22 +0000 (+0100) Subject: [Fix] Fix parsing of unix sockets X-Git-Tag: 1.7.5~38 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=48a973046150e1d95b028ca6c91da3fc21b09e02;p=rspamd.git [Fix] Fix parsing of unix sockets Issue: #2241 --- diff --git a/src/libutil/addr.c b/src/libutil/addr.c index 6735cb14d..dee5fbbb2 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -112,14 +112,15 @@ rspamd_inet_addr_create (gint af) addr = g_malloc0 (sizeof (rspamd_inet_addr_t)); + addr->af = af; + if (af == AF_UNIX) { addr->u.un = g_malloc0 (sizeof (*addr->u.un)); addr->slen = sizeof (addr->u.un->addr); } - - addr->af = af; - - rspamd_ip_validate_af (addr); + else { + rspamd_ip_validate_af (addr); + } return addr; }