diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-18 17:42:29 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-18 17:42:29 +0000 |
commit | 87be736a89369f4c746e5a97352000eceaabac3a (patch) | |
tree | 80ecff5c1e2d79cc0a49032520537c0ba292b2fa /src/libutil/addr.c | |
parent | 9d090bfa97a3de12fbc6123def434609349b9031 (diff) | |
download | rspamd-87be736a89369f4c746e5a97352000eceaabac3a.tar.gz rspamd-87be736a89369f4c746e5a97352000eceaabac3a.zip |
[Fix] More leaks eliminated
Diffstat (limited to 'src/libutil/addr.c')
-rw-r--r-- | src/libutil/addr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libutil/addr.c b/src/libutil/addr.c index c72727c38..d02e43985 100644 --- a/src/libutil/addr.c +++ b/src/libutil/addr.c @@ -1020,7 +1020,13 @@ rspamd_resolve_addrs (const char *begin, size_t len, GPtrArray **addrs, hints.ai_flags = AI_NUMERICSERV|flags; if (len > 0) { - addr_cpy = g_malloc (len + 1); + if (pool) { + addr_cpy = rspamd_mempool_alloc (pool, len + 1); + } + else { + addr_cpy = g_malloc (len + 1); + } + rspamd_strlcpy (addr_cpy, begin, len + 1); } /* Otherwise it will be NULL */ |