MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / del_tree

Function del_tree

modules/drouting/prefix_tree.c:315–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315int
316del_tree(
317 ptree_t* t,
318 osips_free_f free_f
319 )
320{
321 int i,j;
322 if(NULL == t)
323 goto exit;
324 /* delete all the children */
325 for(i=0; i< ptree_children; i++) {
326 /* shm_free the rg array of rt_info */
327 if(NULL!=t->ptnode[i].rg) {
328 for(j=0;j<t->ptnode[i].rg_pos;j++) {
329 /* if non intermediate delete the routing info */
330 if(t->ptnode[i].rg[j].rtlw !=NULL)
331 del_rt_list(t->ptnode[i].rg[j].rtlw, free_f);
332 }
333 func_free(free_f, t->ptnode[i].rg);
334 }
335 /* if non leaf delete all the children */
336 if(t->ptnode[i].next != NULL)
337 del_tree(t->ptnode[i].next, free_f);
338 }
339 func_free(free_f, t);
340exit:
341 return 0;
342}
343
344void
345del_rt_list(

Callers 1

free_rt_dataFunction · 0.70

Calls 1

del_rt_listFunction · 0.85

Tested by

no test coverage detected