From 93995188d99f3452b2bd385f0a9a7f5ebd240f8e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 23 Dec 2004 06:39:58 +0000 Subject: r4342: Fix a memory leak in init_globals(). Andrew Bartlett (This used to be commit cc47b4c6fc932f8257506276eaa1a98a41055f8b) --- source4/param/loadparm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 059b7b1cb2..1ecc53fac0 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -895,6 +895,7 @@ static void init_printer_values(void) static void init_globals(void) { int i; + char *myname; DEBUG(3, ("Initialising global parameters\n")); @@ -913,7 +914,9 @@ static void init_globals(void) do_parameter("socket options", "TCP_NODELAY"); #endif do_parameter("workgroup", DEFAULT_WORKGROUP); - do_parameter("netbios name", get_myname()); + myname = get_myname(); + do_parameter("netbios name", myname); + SAFE_FREE(myname); do_parameter("max protocol", "NT1"); do_parameter("name resolve order", "lmhosts wins host bcast"); -- cgit