diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2014-09-10 03:14:42 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-10-01 11:21:38 +0200 |
commit | 122fdf5ea4fc5b9518404b5149a0bfc88dde2768 (patch) | |
tree | 211c70e935487289739dffd8e965d7d6c5bd6160 | |
parent | 3419a20075625bb9115f86031c1e89b54298e8e9 (diff) | |
download | samba-122fdf5ea4fc5b9518404b5149a0bfc88dde2768.tar.gz samba-122fdf5ea4fc5b9518404b5149a0bfc88dde2768.tar.xz samba-122fdf5ea4fc5b9518404b5149a0bfc88dde2768.zip |
loadparm: Allocate service->copymap in service memory context
This patch adds a restriction that target service structure
must be a valid TALLOC_CTX memory context.
I have traced all call paths and at the moment this is the case,
pservice parameter layways gets allocated on TALLOC_CTX.
Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | lib/param/loadparm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 9953053569..218ef69523 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -1376,13 +1376,17 @@ bool handle_smb_ports(struct loadparm_context *lp_ctx, struct loadparm_service * Initialise a copymap. ***************************************************************************/ +/** + * Initializes service copymap + * Note: pservice *must* be valid TALLOC_CTX + */ void init_copymap(struct loadparm_service *pservice) { int i; TALLOC_FREE(pservice->copymap); - pservice->copymap = bitmap_talloc(NULL, num_parameters()); + pservice->copymap = bitmap_talloc(pservice, num_parameters()); if (!pservice->copymap) DEBUG(0, ("Couldn't allocate copymap!! (size %d)\n", |