git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8341
d0543943-73ff-0310-b7d9-
9358b9ac24b2
sofia_gateway_t *gateway;
char gateway_name[512];
int destroy_nh;
+ int destroy_me;
};
#define set_param(ptr,val) if (ptr) {free(ptr) ; ptr = NULL;} if (val) {ptr = strdup(val);}
break;
}
+ if (sofia_private && sofia_private->destroy_me) {
+ free(sofia_private);
+ sofia_private = NULL;
+ }
+
if (gateway) {
sofia_reg_release_gateway(gateway);
}
if (tech_pvt->sofia_private) {
sofia_private = tech_pvt->sofia_private;
tech_pvt->sofia_private = NULL;
- free(sofia_private);
+ sofia_private->destroy_me = 1;
}
tech_pvt->nh = NULL;
} else if (sofia_private) {
- free(sofia_private);
+ sofia_private->destroy_me = 1;
}
if (nh) {