corrected wrong allocation request

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.4.x@1573 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-08-29 18:53:35 +00:00
parent 65887cbd78
commit 18e9fe3374

View File

@ -413,8 +413,13 @@ bool ftDataMultiplex::locked_handleServerRequest(ftFileProvider *provider,
std::string peerId, std::string hash, uint64_t size,
uint64_t offset, uint32_t chunksize)
{
void *data = malloc(size);
void *data = malloc(chunksize);
if(data == NULL)
{
std::cerr << "WARNING: Could not allocate data for a chunksize of " << chunksize << std::endl ;
return false ;
}
#ifdef MPLEX_DEBUG
std::cerr << "ftDataMultiplex::locked_handleServerRequest()";
std::cerr << "\t peer: " << peerId << " hash: " << hash;