Revision 10ddaca7 src/PeerSampler/cyclon.c

View differences:

src/PeerSampler/cyclon.c
261 261
  return cyclon_proto_change_metadata(context->pc, metadata, metadata_size);
262 262
}
263 263

  
264
void cyclon_destroy(struct peersampler_context **context)
265
{
266
	if (context && *context)
267
	{
268
		if((*context)->r)
269
			free((*context)->r);
270
		if((*context)->local_cache)
271
			cache_free((*context)->local_cache);
272
		if((*context)->flying_cache)
273
			cache_free((*context)->flying_cache);
274
		free(*context);
275
		*context = NULL;
276
	}
277
}
278

  
264 279
struct peersampler_iface cyclon = {
265 280
  .init = cyclon_init,
281
  .destroy = cyclon_destroy,
266 282
  .change_metadata = cyclon_change_metadata,
267 283
  .add_neighbour = cyclon_add_neighbour,
268 284
  .parse_data = cyclon_parse_data,

Also available in: Unified diff