st->trans->thread = 0;
}
AST_LIST_UNLOCK(&peers);
- free(st);
+ ast_free(st);
return NULL;
}
st->trans->thread = 0;
}
AST_LIST_UNLOCK(&peers);
- free(st);
+ ast_free(st);
return NULL;
}
st->trans->thread = 0;
}
AST_LIST_UNLOCK(&peers);
- free(st);
+ ast_free(st);
return NULL;
}
struct dundi_ie_data ied = { 0, };
trans->thread = 0;
ast_log(LOG_WARNING, "Unable to create thread!\n");
- free(st);
+ ast_free(st);
dundi_ie_append_cause(&ied, DUNDI_IE_CAUSE, DUNDI_CAUSE_GENERAL, "Out of threads");
dundi_send(trans, DUNDI_COMMAND_EIDRESPONSE, 0, 1, &ied);
return -1;
if (ast_pthread_create_detached(&lookupthread, NULL, dundi_precache_thread, st)) {
trans->thread = 0;
ast_log(LOG_WARNING, "Unable to create thread!\n");
- free(st);
+ ast_free(st);
memset(&ied, 0, sizeof(ied));
dundi_ie_append_cause(&ied, DUNDI_IE_CAUSE, DUNDI_CAUSE_GENERAL, "Out of threads");
dundi_send(trans, DUNDI_COMMAND_PRECACHERP, 0, 1, &ied);
if (ast_pthread_create_detached(&lookupthread, NULL, dundi_lookup_thread, st)) {
trans->thread = 0;
ast_log(LOG_WARNING, "Unable to create thread!\n");
- free(st);
+ ast_free(st);
memset(&ied, 0, sizeof(ied));
dundi_ie_append_cause(&ied, DUNDI_IE_CAUSE, DUNDI_CAUSE_GENERAL, "Out of threads");
dundi_send(trans, DUNDI_COMMAND_DPRESPONSE, 0, 1, &ied);
while ((pack = AST_LIST_REMOVE_HEAD(p, list))) {
if (pack->retransid > -1)
ast_sched_del(sched, pack->retransid);
- free(pack);
+ ast_free(pack);
}
}
if (!qe->expiration) {
/* Gone... Remove... */
AST_LIST_REMOVE_HEAD(&pcq, list);
- free(qe);
+ ast_free(qe);
} else if (qe->expiration < now) {
/* Process this entry */
qe->expiration = 0;
AST_LIST_TRAVERSE(&peers, p, list) {
for (x = 0;x < DUNDI_TIMING_HISTORY; x++) {
if (p->lookups[x])
- free(p->lookups[x]);
+ ast_free(p->lookups[x]);
p->lookups[x] = NULL;
p->lookuptimes[x] = 0;
}
if (pack->retransid > -1)
ast_sched_del(sched, pack->retransid);
if (needfree)
- free(pack);
+ ast_free(pack);
else
pack->retransid = -1;
}
peer->avgms = 0;
cnt = 0;
if (peer->lookups[DUNDI_TIMING_HISTORY-1])
- free(peer->lookups[DUNDI_TIMING_HISTORY-1]);
+ ast_free(peer->lookups[DUNDI_TIMING_HISTORY-1]);
for (x=DUNDI_TIMING_HISTORY-1;x>0;x--) {
peer->lookuptimes[x] = peer->lookuptimes[x-1];
peer->lookups[x] = peer->lookups[x-1];
/* If used by a thread, mark as dead and be done */
ast_set_flag(trans, FLAG_DEAD);
} else
- free(trans);
+ ast_free(trans);
}
static int dundi_rexmit(const void *data)
ast_log(LOG_NOTICE, "Failed to send packet to '%s'\n", dundi_eid_to_str(eid_str, sizeof(eid_str), &trans->them_eid));
if (cmdresp == DUNDI_COMMAND_ACK)
- free(pack);
+ ast_free(pack);
return res;
}
return -1;
static void drds_destroy(struct dundi_result_datastore *drds)
{
- free(drds);
+ ast_free(drds);
}
static void drds_destroy_cb(void *data)
struct permission *perm;
while ((perm = AST_LIST_REMOVE_HEAD(permlist, list)))
- free(perm);
+ ast_free(perm);
}
static void destroy_peer(struct dundi_peer *peer)
ast_sched_del(sched, peer->qualifyid);
destroy_permissions(&peer->permit);
destroy_permissions(&peer->include);
- free(peer);
+ ast_free(peer);
}
static void destroy_map(struct dundi_mapping *map)
{
if (map->weightstr)
- free(map->weightstr);
- free(map);
+ ast_free(map->weightstr);
+ ast_free(map);
}
static void prune_peers(void)