Ticket #6378: block_cache_leak.patch

File block_cache_leak.patch, 561 bytes (added by jvff, 14 years ago)

This patch frees the data block, but it assumes that the pointer value won't be overwritten by it's own value (otherwise it will point to a freed area). Also, the patch was generated from trunk/src/system/ because I had other files changed that weren't relevant to the patch.

  • kernel/cache/block_cache.cpp

     
    29342934        if (block->parent_data == NULL
    29352935            || block->parent_data != block->current_data) {
    29362936            // we need to move this block over to the new transaction
     2937            if (block->original_data != NULL)
     2938                cache->Free(block->original_data);
    29372939            block->original_data = block->parent_data;
    29382940            if (last == NULL)
    29392941                newTransaction->first_block = block;