[PATCH 01/37] param: ensure CMD_LIST is freed when freeing a parameter

abartlet at samba.org abartlet at samba.org
Fri Jun 20 05:46:16 MDT 2014


From: Garming Sam <garming at catalyst.net.nz>

As well as correctly deallocating the memory, this prevents a potential bug
where s3 globals struct may be freed, but it can be referred to
elsewhere.

Change-Id: I92fc9baa26aee5b4a35b767bed901928cbb7c74f
Signed-off-by: Garming Sam <garming at catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
---
 source3/param/loadparm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 4814d25..39eee91 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -487,7 +487,7 @@ static void free_one_parameter_common(void *parm_ptr,
 	    (parm.type == P_USTRING))
 	{
 		string_free((char**)parm_ptr);
-	} else if (parm.type == P_LIST) {
+	} else if (parm.type == P_LIST || parm.type == P_CMDLIST) {
 		TALLOC_FREE(*((char***)parm_ptr));
 	}
 }
-- 
1.9.3



More information about the samba-technical mailing list