rem: block->updated = NULL;
add: if (block->original != NULL) { free(block->original); block->original = NULL; }
context: cache_transaction_end(void *_cache, int32 id){	block_cache *cache = (block_cache *)_cache;	BenaphoreLocker locker(cache);	cache_transaction *transaction = lookup_transaction(cache, id);	if (transaction == NULL) {		panic("cache_transaction_end(): invalid transaction ID\n");		return B_BAD_VALUE;	}	// iterate through all blocks and make the updated contents current	cached_block *block = transaction->first_block, *next;	for (; block != NULL; block = next) {		next = block->transaction_next;		if (block->previous_transaction != NULL) {			// need to write back pending changes			write_cached_block(cache, block);		}					// ToDo: unfortunately, at least for now, we have to keep the		//	block data pointer constant. Therefore, we have to copy		//	the data.		if (block->data != NULL) {			memcpy(block->data, block->updated, cache->block_size);			free(block->updated);		} else			block->data = block->updated;		block->updated = NULL;		// move the block to the previous transaction list		transaction->blocks.Add(block);		block->previous_transaction = transaction;		block->transaction_next = NULL;		block->transaction = NULL;	}	transaction->open = false;	return B_OK;}