From: Vsevolod Stakhov Date: Fri, 15 Jun 2018 14:05:08 +0000 (+0100) Subject: [Minor] Fix leak in unix sockets parsing X-Git-Tag: 1.7.6~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7718fb14602c410dc16a316bb4e9cc87850c0ee4;p=rspamd.git [Minor] Fix leak in unix sockets parsing --- diff --git a/src/libutil/addr.c b/src/libutil/addr.c index a00d2a86b..ce97e486c 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -349,7 +349,6 @@ rspamd_parse_unix_path (rspamd_inet_addr_t **target, const char *src) bool has_group = false; tokens = g_strsplit_set (src, " ,", -1); - addr = rspamd_inet_addr_create (AF_UNIX); rspamd_strlcpy (addr->u.un->addr.sun_path, tokens[0], @@ -422,6 +421,7 @@ rspamd_parse_unix_path (rspamd_inet_addr_t **target, const char *src) } g_free (pwbuf); + g_strfreev (tokens); if (target) { rspamd_ip_validate_af (addr); @@ -435,6 +435,7 @@ rspamd_parse_unix_path (rspamd_inet_addr_t **target, const char *src) err: + g_strfreev (tokens); g_free (pwbuf); rspamd_inet_address_free (addr); return FALSE;