]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix parsing of unix sockets
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 12 May 2018 14:35:22 +0000 (15:35 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 12 May 2018 14:35:22 +0000 (15:35 +0100)
Issue: #2241

src/libutil/addr.c

index 6735cb14d5fef3d6fee56e3ff177546cb24e420b..dee5fbbb28ed102f03dad785470125d71b1c1821 100644 (file)
@@ -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;
 }