mirror of
https://github.com/samba-team/samba.git
synced 2025-02-09 09:57:48 +03:00
r24410: - I got tricked by function naming. Contrary to what seemed obvious to me,
prs_mem_free() is not the function to be called to free memory allocated by prs_alloc_mem(). I've added a comment so others may not get bitten too. - Remove incorrect memory free calls added yesterday to replace SAFE_FREE. The memory is actually now on a talloc context, so gets freed by the caller when that context is freed. We don't need to free it iternally. Derrell
This commit is contained in:
parent
ee6f212ed0
commit
2fde343150
@ -5142,8 +5142,6 @@ cacl_set(TALLOC_CTX *ctx,
|
|||||||
switch (mode) {
|
switch (mode) {
|
||||||
case SMBC_XATTR_MODE_REMOVE_ALL:
|
case SMBC_XATTR_MODE_REMOVE_ALL:
|
||||||
old->dacl->num_aces = 0;
|
old->dacl->num_aces = 0;
|
||||||
prs_mem_free(old->dacl->aces);
|
|
||||||
prs_mem_free(&old->dacl);
|
|
||||||
old->dacl = NULL;
|
old->dacl = NULL;
|
||||||
dacl = old->dacl;
|
dacl = old->dacl;
|
||||||
break;
|
break;
|
||||||
@ -5162,8 +5160,6 @@ cacl_set(TALLOC_CTX *ctx,
|
|||||||
}
|
}
|
||||||
old->dacl->num_aces--;
|
old->dacl->num_aces--;
|
||||||
if (old->dacl->num_aces == 0) {
|
if (old->dacl->num_aces == 0) {
|
||||||
prs_mem_free(&old->dacl->aces);
|
|
||||||
prs_mem_free(&old->dacl);
|
|
||||||
old->dacl = NULL;
|
old->dacl = NULL;
|
||||||
}
|
}
|
||||||
found = True;
|
found = True;
|
||||||
|
@ -122,6 +122,10 @@ BOOL prs_init(prs_struct *ps, uint32 size, TALLOC_CTX *ctx, BOOL io)
|
|||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
Delete the memory in a parse structure - if we own it.
|
Delete the memory in a parse structure - if we own it.
|
||||||
|
|
||||||
|
NOTE: Contrary to the somewhat confusing naming, this function is not
|
||||||
|
intended for freeing memory allocated by prs_alloc_mem(). That memory
|
||||||
|
is attached to the talloc context given by ps->mem_ctx.
|
||||||
********************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
void prs_mem_free(prs_struct *ps)
|
void prs_mem_free(prs_struct *ps)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user