Author: derrell Date: 2007-08-14 14:27:42 +0000 (Tue, 14 Aug 2007) New Revision: 24410
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24410 Log: - 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 Modified: branches/SAMBA_3_2/source/libsmb/libsmbclient.c branches/SAMBA_3_2/source/rpc_parse/parse_prs.c Changeset: Modified: branches/SAMBA_3_2/source/libsmb/libsmbclient.c =================================================================== --- branches/SAMBA_3_2/source/libsmb/libsmbclient.c 2007-08-14 13:57:36 UTC (rev 24409) +++ branches/SAMBA_3_2/source/libsmb/libsmbclient.c 2007-08-14 14:27:42 UTC (rev 24410) @@ -5142,8 +5142,6 @@ switch (mode) { case SMBC_XATTR_MODE_REMOVE_ALL: old->dacl->num_aces = 0; - prs_mem_free(old->dacl->aces); - prs_mem_free(&old->dacl); old->dacl = NULL; dacl = old->dacl; break; @@ -5162,8 +5160,6 @@ } old->dacl->num_aces--; if (old->dacl->num_aces == 0) { - prs_mem_free(&old->dacl->aces); - prs_mem_free(&old->dacl); old->dacl = NULL; } found = True; Modified: branches/SAMBA_3_2/source/rpc_parse/parse_prs.c =================================================================== --- branches/SAMBA_3_2/source/rpc_parse/parse_prs.c 2007-08-14 13:57:36 UTC (rev 24409) +++ branches/SAMBA_3_2/source/rpc_parse/parse_prs.c 2007-08-14 14:27:42 UTC (rev 24410) @@ -122,6 +122,10 @@ /******************************************************************* 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)
