1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Kamen Mazdrashki 2014-09-10 03:14:42 +02:00 committed by Andrew Bartlett
parent 3419a20075
commit 122fdf5ea4

View File

@ -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",