diff --git a/src/cluster-cache.c b/src/cluster-cache.c index 25cdea7..97332c5 100644 --- a/src/cluster-cache.c +++ b/src/cluster-cache.c @@ -162,12 +162,14 @@ enum ec3_status cluster_cache_get( return status; } + entry->e_data = buf; + size_t nr_read = 0; enum b_status status2 = b_file_read( cache->c_storage, entry->e_storage_offset, entry->e_length, - buf, + entry->e_data, &nr_read); if (!B_OK(status2)) { @@ -178,7 +180,7 @@ enum ec3_status cluster_cache_get( return EC3_ERR_IO_FAILURE; } - memcpy(out, buf, nr_read); + memcpy(out, entry->e_data, nr_read); *cluster_size = nr_read; return EC3_SUCCESS; }