summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-etc-hosts.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-07-26 17:33:23 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-07-26 17:45:34 +0900
commitc0df8f834aec7ca7ae3737813c487566a90b873a (patch)
tree2aae5af3e5c98fdd9a2845b9e54c3fe6888d74e2 /src/resolve/resolved-etc-hosts.c
parent82296b3e0730fc087faf552fcfd5657419cf22bc (diff)
downloadsystemd-c0df8f834aec7ca7ae3737813c487566a90b873a.tar.gz
resolve: fix memleak
Diffstat (limited to 'src/resolve/resolved-etc-hosts.c')
-rw-r--r--src/resolve/resolved-etc-hosts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resolve/resolved-etc-hosts.c b/src/resolve/resolved-etc-hosts.c
index 507f68b47f..08591661f6 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;
}
}