fixed missing removal of deleted data causing a crash when large messages cause an error in Global Router

This commit is contained in:
csoler 2015-08-21 20:45:41 -04:00
parent 176c3abd8c
commit dea7c774b4

View File

@ -587,7 +587,8 @@ RsGRouterAbstractMsgItem *GRouterDataInfo::addDataChunk(RsGRouterTransactionChun
std::cerr << " ERROR: chunk numbering is wrong. Dropping." << std::endl; std::cerr << " ERROR: chunk numbering is wrong. Dropping." << std::endl;
delete chunk ; delete chunk ;
delete incoming_data_buffer ; delete incoming_data_buffer ;
return NULL; incoming_data_buffer = NULL ;
return NULL;
} }
incoming_data_buffer->chunk_data = (uint8_t*)realloc((uint8_t*)incoming_data_buffer->chunk_data,incoming_data_buffer->chunk_size + chunk->chunk_size) ; incoming_data_buffer->chunk_data = (uint8_t*)realloc((uint8_t*)incoming_data_buffer->chunk_data,incoming_data_buffer->chunk_size + chunk->chunk_size) ;
memcpy(&incoming_data_buffer->chunk_data[incoming_data_buffer->chunk_size],chunk->chunk_data,chunk->chunk_size) ; memcpy(&incoming_data_buffer->chunk_data[incoming_data_buffer->chunk_size],chunk->chunk_data,chunk->chunk_size) ;