fixed core dump (double delete) when getFileData fails

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1504 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-08-09 15:55:31 +00:00
parent 47fce35968
commit 6928b3c426

View File

@ -124,8 +124,8 @@ bool ftFileProvider::getFileData(uint64_t offset, uint32_t &chunk_size, void *da
if (1 != fread(data, data_size, 1, fd)) if (1 != fread(data, data_size, 1, fd))
{ {
std::cerr << "ftFileProvider::getFileData() Failed to get data!"; std::cerr << "ftFileProvider::getFileData() Failed to get data. Data_size=" << data_size << ", base_loc=" << base_loc << " !";
free(data); //free(data); No!! It's already freed upwards in ftDataMultiplex::locked_handleServerRequest()
return 0; return 0;
} }