public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batctl: fix a memory leak in bat_hosts_init
@ 2011-07-30 11:16 Jonathan Neuschäfer
  2011-08-03  7:18 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Neuschäfer @ 2011-07-30 11:16 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Jonathan Neuschäfer

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);
 }
 
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batctl: fix a memory leak in bat_hosts_init
  2011-07-30 11:16 [B.A.T.M.A.N.] [PATCH] batctl: fix a memory leak in bat_hosts_init Jonathan Neuschäfer
@ 2011-08-03  7:18 ` Marek Lindner
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2011-08-03  7:18 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Jonathan Neuschäfer

On Saturday, July 30, 2011 13:16:05 Jonathan Neuschäfer wrote:
> normalized was not being free'd when hash_new failed, now it is.

Applied in revision 87ec067.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-03  7:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-30 11:16 [B.A.T.M.A.N.] [PATCH] batctl: fix a memory leak in bat_hosts_init Jonathan Neuschäfer
2011-08-03  7:18 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox