[asterisk-commits] rizzo: branch rizzo/astobj2 r76214 - /team/rizzo/astobj2/channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jul 20 16:42:11 CDT 2007
Author: rizzo
Date: Fri Jul 20 16:42:10 2007
New Revision: 76214
URL: http://svn.digium.com/view/asterisk?view=rev&rev=76214
Log:
now replace free() with ast_free()
Modified:
team/rizzo/astobj2/channels/chan_sip.c
Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=76214&r1=76213&r2=76214
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Fri Jul 20 16:42:10 2007
@@ -1916,7 +1916,7 @@
ast_sched_del(sched, reg->timeout);
ast_string_field_free_pools(reg);
regobjs--;
- free(reg);
+ ast_free(reg);
}
static void *registry_unref(struct sip_registry *reg)
@@ -2279,7 +2279,7 @@
if (!(hist = ast_calloc(1, sizeof(*hist) + l)))
return;
if (!p->history && !(p->history = ast_calloc(1, sizeof(*p->history)))) {
- free(hist);
+ ast_free(hist);
return;
}
memcpy(hist->event, buf, l);
@@ -2404,7 +2404,7 @@
UNLINK(cur, pvt->packets, prev);
pkt->pvt = pvt_unref(pvt); /* release the reference to the dialog */
sip_pvt_unlock(pvt);
- free(pkt);
+ ast_free(pkt);
return 0;
}
}
@@ -2557,7 +2557,7 @@
}
UNLINK(cur, p->packets, prev);
cur->pvt = pvt_unref(cur->pvt);
- free(cur);
+ ast_free(cur);
break;
}
}
@@ -2930,7 +2930,7 @@
ast_debug(3, "Destroying SIP peer %s\n", peer->name);
if (peer->outboundproxy)
- free(peer->outboundproxy);
+ ast_free(peer->outboundproxy);
peer->outboundproxy = NULL;
/* Delete it, it needs to disappear */
@@ -2967,7 +2967,7 @@
peer->auth = NULL;
if (peer->dnsmgr)
ast_dnsmgr_release(peer->dnsmgr);
- free(peer);
+ ast_free(peer);
}
/*! \brief Update peer data in database (if used) */
@@ -3118,7 +3118,7 @@
ruserobjs--;
else
suserobjs--;
- free(user);
+ ast_free(user);
}
/*! \brief Load user from realtime storage
@@ -3530,7 +3530,7 @@
sip_dump_history(p);
if (p->options)
- free(p->options);
+ ast_free(p->options);
if (p->stateid > -1)
ast_extension_state_del(p->stateid, NULL);
@@ -3562,8 +3562,8 @@
if (p->history) {
struct sip_history *hist;
while( (hist = AST_LIST_REMOVE_HEAD(p->history, list)) )
- free(hist);
- free(p->history);
+ ast_free(hist);
+ ast_free(p->history);
p->history = NULL;
}
@@ -3593,7 +3593,7 @@
if (cp->retransid > -1)
ast_sched_del(sched, cp->retransid);
cp->pvt = pvt_unref(cp->pvt);
- free(cp);
+ ast_free(cp);
}
if (p->registry) {
/* XXX why this is only for ourselves ?
@@ -3628,7 +3628,7 @@
pvt_unref(p); /* automatically calls pvt_destructor on ao2*/
ast_mutex_destroy(&p->pvt_lock); /* XXX not used in ao2 */
pvt_destructor(p);
- free(p);
+ ast_free(p);
#endif
return NULL;
}
@@ -5269,7 +5269,7 @@
if (ast_string_field_init(reg, 256)) {
ast_log(LOG_ERROR, "Out of memory. Can't allocate SIP registry strings\n");
- free(reg);
+ ast_free(reg);
return -1;
}
@@ -6584,7 +6584,7 @@
ast_string_field_free_pools(p);
- free(data);
+ ast_free(data);
}
/*! \brief Transmit response, no retransmits, using a temporary pvt structure */
@@ -8323,7 +8323,7 @@
return;
if (p->refer->refer_call)
p->refer->refer_call = pvt_unref(p->refer->refer_call);
- free(p->refer);
+ ast_free(p->refer);
p->refer = NULL;
}
@@ -8811,7 +8811,7 @@
while (route) {
next = route->next;
- free(route);
+ ast_free(route);
route = next;
}
}
@@ -13898,7 +13898,7 @@
transferee = d->chan1;
transferer = d->chan2;
copy_request(&req, &d->req);
- free(d);
+ ast_free(d);
if (!transferee || !transferer) {
ast_log(LOG_ERROR, "Missing channels for parking! Transferer %s Transferee %s\n", transferer ? "<available>" : "<missing>", transferee ? "<available>" : "<missing>" );
@@ -14027,7 +14027,7 @@
d->seqno = seqno;
if (ast_pthread_create_background(&th, &attr, sip_park_thread, d) < 0) {
/* Could not start thread */
- free(d); /* We don't need it anymore. If thread is created, d will be free'd
+ ast_free(d); /* We don't need it anymore. If thread is created, d will be free'd
by sip_park_thread() */
pthread_attr_destroy(&attr);
return 0;
@@ -16222,13 +16222,13 @@
buf2 = ast_calloc(1,res+1);
ast_mark(prof_calloc, 0);
if (buf2)
- free(buf2);
+ ast_free(buf2);
if (buf) {
ast_mark(prof_copy, 1);
bcopy(req.data, buf, res+1);
ast_mark(prof_copy, 0);
- free(buf);
+ ast_free(buf);
}
}
@@ -17073,7 +17073,7 @@
AST_LIST_LOCK(&domain_list);
while ((d = AST_LIST_REMOVE_HEAD(&domain_list, list)))
- free(d);
+ ast_free(d);
AST_LIST_UNLOCK(&domain_list);
}
@@ -17145,7 +17145,7 @@
while (a) {
b = a;
a = a->next;
- free(b);
+ ast_free(b);
}
return 1;
@@ -17547,7 +17547,7 @@
asprintf(®_string, "%s:%s@%s/%s", peer->username, peer->secret, peer->tohost, callback);
if (reg_string) {
sip_register(reg_string, 0); /* XXX TODO: count in registry_count */
- free(reg_string);
+ ast_free(reg_string);
}
}
return peer;
More information about the asterisk-commits
mailing list