[asterisk-commits] russell: trunk r88077 - in /trunk: channels/chan_sip.c pbx/pbx_dundi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 1 10:56:25 CDT 2007


Author: russell
Date: Thu Nov  1 10:56:25 2007
New Revision: 88077

URL: http://svn.digium.com/view/asterisk?view=rev&rev=88077
Log:
Change some uses of free() to ast_free().  (No functional differences.)

(closes issue #11138)
Reported by: eliel
Patches: 
      pbx_dundi.c.patch uploaded by eliel (license 64)
	  chan_sip.c.patch uploaded by eliel (license 64)

Modified:
    trunk/channels/chan_sip.c
    trunk/pbx/pbx_dundi.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=88077&r1=88076&r2=88077
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Nov  1 10:56:25 2007
@@ -17490,7 +17490,7 @@
 
 		strsep(&context, "@");
 		if (ast_strlen_zero(mbox)) {
-			free(mailbox);
+			ast_free(mailbox);
 			continue;
 		}
 		mailbox->mailbox = ast_strdup(mbox);

Modified: trunk/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_dundi.c?view=diff&rev=88077&r1=88076&r2=88077
==============================================================================
--- trunk/pbx/pbx_dundi.c (original)
+++ trunk/pbx/pbx_dundi.c Thu Nov  1 10:56:25 2007
@@ -679,7 +679,7 @@
 		st->trans->thread = 0;
 	}
 	AST_LIST_UNLOCK(&peers);
-	free(st);
+	ast_free(st);
 	return NULL;	
 }
 
@@ -712,7 +712,7 @@
 		st->trans->thread = 0;
 	}
 	AST_LIST_UNLOCK(&peers);
-	free(st);
+	ast_free(st);
 	return NULL;	
 }
 
@@ -772,7 +772,7 @@
 		st->trans->thread = 0;
 	}
 	AST_LIST_UNLOCK(&peers);
-	free(st);
+	ast_free(st);
 	return NULL;	
 }
 
@@ -818,7 +818,7 @@
 			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;
@@ -1042,7 +1042,7 @@
 		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);
@@ -1126,7 +1126,7 @@
 		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);
@@ -1975,7 +1975,7 @@
 	while ((pack = AST_LIST_REMOVE_HEAD(p, list))) {
 		if (pack->retransid > -1)
 			ast_sched_del(sched, pack->retransid);
-		free(pack);
+		ast_free(pack);
 	}
 }
 
@@ -2199,7 +2199,7 @@
 			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;
@@ -2297,7 +2297,7 @@
 		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;
 			}
@@ -2937,7 +2937,7 @@
 	if (pack->retransid > -1)
 		ast_sched_del(sched, pack->retransid);
 	if (needfree)
-		free(pack);
+		ast_free(pack);
 	else
 		pack->retransid = -1;
 }
@@ -2978,7 +2978,7 @@
 						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];
@@ -3022,7 +3022,7 @@
 		/* 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)
@@ -3113,7 +3113,7 @@
 			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;
@@ -3958,7 +3958,7 @@
 
 static void drds_destroy(struct dundi_result_datastore *drds)
 {
-	free(drds);
+	ast_free(drds);
 }
 
 static void drds_destroy_cb(void *data)
@@ -4165,7 +4165,7 @@
 	struct permission *perm;
 
 	while ((perm = AST_LIST_REMOVE_HEAD(permlist, list)))
-		free(perm);
+		ast_free(perm);
 }
 
 static void destroy_peer(struct dundi_peer *peer)
@@ -4178,14 +4178,14 @@
 		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)




More information about the asterisk-commits mailing list