if (peer->pokeexpire > -1)
ast_sched_del(sched, peer->pokeexpire);
register_peer_exten(peer, 0);
+ ast_free_ha(peer->ha);
free(peer);
}
memcpy(&r->recv, &r->sa, sizeof(r->recv));
} else {
if (p->temponly) {
- if (p->ha) {
- ast_free_ha(p->ha);
- }
- free(p);
+ destroy_peer(p);
}
p = NULL;
}
return -1;
else {
if (p->temponly) {
- if (p->ha) {
- ast_free_ha(p->ha);
- }
- free(p);
+ destroy_peer(p);
}
return 0;
}
u->inUse++;
}
ast_mutex_unlock(&userl.lock);
+ if (u->temponly) {
+ destroy_user(u);
+ }
return -1;
}
}
if ( u->outUse >= u->outgoinglimit ) {
ast_log(LOG_ERROR, "Outgoing call from user '%s' rejected due to usage limit of %d\n", u->name, u->outgoinglimit);
ast_mutex_unlock(&userl.lock);
+ if (u->temponly) {
+ destroy_user(u);
+ }
return -1;
}
}
ast_log(LOG_ERROR, "update_user_counter(%s,%d) called with no event!\n",u->name,event);
}
ast_mutex_unlock(&userl.lock);
+ if (u->temponly) {
+ destroy_user(u);
+ }
return 0;
}
}
+ if (user && user->temponly) {
+ destroy_user(user);
+ }
+
return res;
}
static int check_user(struct sip_pvt *p, struct sip_request *req, char *cmd, char *uri, int reliable, struct sockaddr_in *sin, int ignore)
}
ast_mutex_unlock(&peerl.lock);
+
+ if (peer && peer->dynamic) {
+ destroy_peer(peer);
+ }
return RESULT_SUCCESS;
}
if (hp)
res = AST_DEVICE_UNKNOWN;
}
+
+ if (p && p->dynamic) {
+ destroy_peer(p);
+ }
return res;
}
v = v->next;
}
}
- if (oldha)
- ast_free_ha(oldha);
+ ast_free_ha(oldha);
return user;
}
reg_source_db(peer);
peer->delme = 0;
}
- if (oldha)
- ast_free_ha(oldha);
+ ast_free_ha(oldha);
return peer;
}
return -1;
}
/* Free memory for local network address mask */
- if (localaddr) {
- ast_free_ha(localaddr);
- }
- ast_mutex_destroy(&userl.lock);
- ast_mutex_destroy(&peerl.lock);
- ast_mutex_destroy(®l.lock);
+ ast_free_ha(localaddr);
+ ast_mutex_destroy(&userl.lock);
+ ast_mutex_destroy(&peerl.lock);
+ ast_mutex_destroy(®l.lock);
return 0;
}