param: ensure CMD_LIST is freed when freeing a parameter
authorGarming Sam <garming@catalyst.net.nz>
Wed, 7 May 2014 23:43:53 +0000 (11:43 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 7 Jul 2014 21:32:35 +0000 (23:32 +0200)
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@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
source3/param/loadparm.c

index 6e64482ee3e2c514e0284b59e708d3aa6859deaa..c4dd803354ebfb7819986b986be627d1a61c377c 100644 (file)
@@ -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));
        }
 }