svn commit: samba r22509 - in branches: SAMBA_3_0/source/groupdb	SAMBA_3_0_25/source/groupdb Author: jerry Date: 2007-04-25 09:32:03 +0000 (Wed, 25 Apr 2007) New Revision: 22509 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22509 Log: Fix some memory corruption caused by calling free() on talloc()'d memory when adding/removing members from Local Groups. Modified:    branches/SAMBA_3_0/source/groupdb/mapping_tdb.c    branches/SAMBA_3_0_25/source/groupdb/mapping_tdb.c Changeset: Modified: branches/SAMBA_3_0/source/groupdb/mapping_tdb.c =================================================================== --- branches/SAMBA_3_0/source/groupdb/mapping_tdb.c	2007-04-25 02:43:23 UTC (rev 22508) +++ branches/SAMBA_3_0/source/groupdb/mapping_tdb.c	2007-04-25 09:32:03 UTC (rev 22509) @@ -455,11 +455,11 @@    	for (i=0; i<num; i++) {  		if (sid_compare(alias, &sids[i]) == 0) { -			SAFE_FREE(sids); +			TALLOC_FREE(sids);  			return True;  		}  	} -	SAFE_FREE(sids); +	TALLOC_FREE(sids);  	return False;  }   @@ -622,7 +622,7 @@  	}    	if (!found) { -		SAFE_FREE(sids); +		TALLOC_FREE(sids);  		return NT_STATUS_MEMBER_NOT_IN_ALIAS;  	}   @@ -641,7 +641,7 @@  	member_string = SMB_STRDUP("");    	if (member_string == NULL) { -		SAFE_FREE(sids); +		TALLOC_FREE(sids);  		return NT_STATUS_NO_MEMORY;  	}   @@ -653,7 +653,7 @@    		SAFE_FREE(s);  		if (member_string == NULL) { -			SAFE_FREE(sids); +			TALLOC_FREE(sids);  			return NT_STATUS_NO_MEMORY;  		}  	} @@ -663,7 +663,7 @@  	result = tdb_store_bystring(tdb, key, dbuf, 0) == 0 ?  		NT_STATUS_OK : NT_STATUS_ACCESS_DENIED;   -	SAFE_FREE(sids); +	TALLOC_FREE(sids);  	SAFE_FREE(member_string);    	return result; Modified: branches/SAMBA_3_0_25/source/groupdb/mapping_tdb.c =================================================================== --- branches/SAMBA_3_0_25/source/groupdb/mapping_tdb.c	2007-04-25 02:43:23 UTC (rev 22508) +++ branches/SAMBA_3_0_25/source/groupdb/mapping_tdb.c	2007-04-25 09:32:03 UTC (rev 22509) @@ -466,11 +466,11 @@    	for (i=0; i<num; i++) {  		if (sid_compare(alias, &sids[i]) == 0) { -			SAFE_FREE(sids); +			TALLOC_FREE(sids);  			return True;  		}  	} -	SAFE_FREE(sids); +	TALLOC_FREE(sids);  	return False;  }   @@ -637,7 +637,7 @@  	}    	if (!found) { -		SAFE_FREE(sids); +		TALLOC_FREE(sids);  		return NT_STATUS_MEMBER_NOT_IN_ALIAS;  	}   @@ -659,7 +659,7 @@  	member_string = SMB_STRDUP("");    	if (member_string == NULL) { -		SAFE_FREE(sids); +		TALLOC_FREE(sids);  		return NT_STATUS_NO_MEMORY;  	}   @@ -671,7 +671,7 @@    		SAFE_FREE(s);  		if (member_string == NULL) { -			SAFE_FREE(sids); +			TALLOC_FREE(sids);  			return NT_STATUS_NO_MEMORY;  		}  	} @@ -682,7 +682,7 @@  	result = tdb_store(tdb, kbuf, dbuf, 0) == 0 ?  		NT_STATUS_OK : NT_STATUS_ACCESS_DENIED;   -	SAFE_FREE(sids); +	TALLOC_FREE(sids);  	SAFE_FREE(member_string);    	return result;