rem: if (block->updated == NULL) { block->updated = malloc(cache->block_size); if (block->updated == NULL) {
add: if (block->data != NULL && block->original == NULL) {  block->original = malloc(cache->block_size); if (block->original == NULL) {
context: get_writable_cached_block(block_cache *cache, off_t blockNumber, off_t base, off_t length,	int32 transactionID, bool cleared){	BenaphoreLocker locker(cache);	cached_block *block = get_cached_block(cache, blockNumber, cleared);	if (block == NULL)		return NULL;	// if there is no transaction support, we just return the current block	if (transactionID == -1) {		if (cleared && block->data == NULL) {			block->data = malloc(cache->block_size);			if (block->data == NULL) {				put_cached_block(cache, block);				return NULL;			}		}		if (cleared)			memset(block->data, 0, cache->block_size);		block->updated = block->data;			// mark the block as dirty		return block->data;	}	// ToDo: note, even if we panic, we should probably put the cached block	//	back before we return	if (block->transaction != NULL && block->transaction->id != transactionID) {		// ToDo: we have to wait here until the other transaction is done.		//	Maybe we should even panic, since we can't prevent any deadlocks.		panic("block_cache_get_writable(): asked to get busy writable block\n");		return NULL;	}	if (block->transaction == NULL && transactionID != -1) {		// get new transaction		cache_transaction *transaction = lookup_transaction(cache, transactionID);		if (transaction == NULL) {			panic("block_cache_get_writable(): invalid transaction!\n");			return NULL;		}		if (!transaction->open) {			panic("block_cache_get_writable(): transaction already done!\n");			return NULL;		}		block->transaction = transaction;		// attach the block to the transaction block list		block->transaction_next = transaction->first_block;		transaction->first_block = block->transaction_next;		transaction->num_blocks++;	}	if (block->updated == NULL) {		block->updated = malloc(cache->block_size);		if (block->updated == NULL) {			put_cached_block(cache, block);			return NULL;		}		if (!cleared)			memcpy(block->updated, block->data, cache->block_size);	}	if (cleared)		memset(block->updated, 0, cache->block_size);		return block->updated;}