From: Yu Watanabe Date: Thu, 26 Jul 2018 08:33:23 +0000 (+0900) Subject: resolve: fix memleak X-Git-Tag: v240~887^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0df8f834aec7ca7ae3737813c487566a90b873a;p=thirdparty%2Fsystemd.git resolve: fix memleak --- diff --git a/src/resolve/resolved-etc-hosts.c b/src/resolve/resolved-etc-hosts.c index 507f68b47fd..08591661f6f 100644 --- a/src/resolve/resolved-etc-hosts.c +++ b/src/resolve/resolved-etc-hosts.c @@ -79,7 +79,7 @@ static const struct hash_ops etc_hosts_item_ops = { }; static int add_item(Manager *m, int family, const union in_addr_union *address, char **names) { - + _cleanup_strv_free_ char **dummy = names; EtcHostsItem key = { .family = family, .address = *address, @@ -125,6 +125,8 @@ static int add_item(Manager *m, int family, const union in_addr_union *address, free(item); return log_oom(); } + + dummy = NULL; } }