normalized was not being free'd when hash_new failed, now it is.
Signed-off-by: Jonathan Neuschäfer j.neuschaefer@gmx.net --- bat-hosts.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/bat-hosts.c b/bat-hosts.c index 0ea4134..179e733 100644 --- a/bat-hosts.c +++ b/bat-hosts.c @@ -179,7 +179,7 @@ void bat_hosts_init(int read_opt) if (!host_hash) { if (read_opt & USE_BAT_HOSTS) printf("Warning - could not create bat hosts hash table\n"); - return; + goto out; }
homedir = getenv("HOME"); @@ -216,6 +216,7 @@ void bat_hosts_init(int read_opt) parse_hosts_file(&host_hash, normalized + (i * PATH_MAX), read_opt); }
+out: free(normalized); }