aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/addr.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-05-12 15:35:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-05-12 15:35:22 +0100
commit48a973046150e1d95b028ca6c91da3fc21b09e02 (patch)
treef99153eae86e4f0ed382e2d8c13f9f425b595c27 /src/libutil/addr.c
parente39900d3ee88253e7b5d4d933b9469280ee5b761 (diff)
downloadrspamd-48a973046150e1d95b028ca6c91da3fc21b09e02.tar.gz
rspamd-48a973046150e1d95b028ca6c91da3fc21b09e02.zip
[Fix] Fix parsing of unix sockets
Issue: #2241
Diffstat (limited to 'src/libutil/addr.c')
-rw-r--r--src/libutil/addr.c9
1 files changed, 5 insertions, 4 deletions
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;
}