Index: apps/app_adsiprog.c =================================================================== --- apps/app_adsiprog.c (revision 67164) +++ apps/app_adsiprog.c (working copy) @@ -1384,11 +1384,11 @@ break; case STATE_INSUB: ast_log(LOG_WARNING, "Missing ENDSUB at end of file %s\n", script); - free(scr); + ast_free(scr); return NULL; case STATE_INKEY: ast_log(LOG_WARNING, "Missing ENDKEY at end of file %s\n", script); - free(scr); + ast_free(scr); return NULL; } err = 0; @@ -1414,7 +1414,7 @@ } if (err) { - free(scr); + ast_free(scr); return NULL; } return scr; @@ -1451,7 +1451,7 @@ if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "User rejected download attempt\n"); ast_log(LOG_NOTICE, "User rejected download on channel %s\n", chan->name); - free(scr); + ast_free(scr); return -1; } @@ -1538,10 +1538,10 @@ if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Download attempt failed\n"); ast_log(LOG_NOTICE, "Download failed on %s\n", chan->name); - free(scr); + ast_free(scr); return -1; } - free(scr); + ast_free(scr); ast_adsi_unload_session(chan); return 0; } Index: apps/app_festival.c =================================================================== --- apps/app_festival.c (revision 67164) +++ apps/app_festival.c (working copy) @@ -525,7 +525,7 @@ ast_log(LOG_DEBUG,"Festival WV command\n"); waveform = socket_receive_file_to_buff(fd,&filesize); res = send_waveform_to_channel(chan,waveform,filesize, intstr); - free(waveform); + ast_free(waveform); break; } else if (strcmp(ack,"LP\n") == 0) { /* receive an s-expr */ @@ -534,7 +534,7 @@ waveform = socket_receive_file_to_buff(fd,&filesize); waveform[filesize]='\0'; ast_log(LOG_WARNING,"Festival returned LP : %s\n",waveform); - free(waveform); + ast_free(waveform); } else if (strcmp(ack,"ER\n") == 0) { /* server got an error */ ast_log(LOG_WARNING,"Festival returned ER\n"); res=-1; Index: apps/app_alarmreceiver.c =================================================================== --- apps/app_alarmreceiver.c (revision 67164) +++ apps/app_alarmreceiver.c (working copy) @@ -727,7 +727,7 @@ for(elp = event_head; (elp != NULL);){ efree = elp; elp = elp->next; - free(efree); + ast_free(efree); } Index: apps/app_rpt.c =================================================================== --- apps/app_rpt.c (revision 67164) +++ apps/app_rpt.c (working copy) @@ -1353,7 +1353,7 @@ l = l->next; continue; } - if ((s = (struct rpt_lstat *) ast_calloc(1, sizeof(struct rpt_lstat))) == NULL) { + if ((s = ast_calloc(1, sizeof(*s))) == NULL) { ast_log(LOG_ERROR, "Malloc failed in rpt_do_lstats\n"); rpt_mutex_unlock(&myrpt->lock); /* UNLOCK */ return RESULT_FAILURE; @@ -2186,7 +2186,7 @@ l = l->next; continue; } - m = ast_malloc(sizeof(struct rpt_link)); + m = ast_malloc(sizeof(*m)); if (!m) { ast_log(LOG_WARNING, "Cannot alloc memory on %s\n", mychannel->name); remque((struct qelem *)mytele); @@ -2453,7 +2453,7 @@ struct rpt_link *mylink = (struct rpt_link *) data; int res; - tele = ast_calloc(1, sizeof(struct rpt_tele)); + tele = ast_calloc(1, sizeof(*tele)); if (!tele) { ast_log(LOG_WARNING, "Unable to allocate memory\n"); pthread_exit(NULL); @@ -2869,7 +2869,7 @@ rpt_mutex_unlock(&myrpt->lock); ast_copy_string(myrpt->lastlinknode, digitbuf, MAXNODESTR); /* establish call in monitor mode */ - l = ast_calloc(1, sizeof(struct rpt_link)); + l = ast_calloc(1, sizeof(*l)); if (!l) { ast_log(LOG_WARNING, "Unable to malloc\n"); return DC_ERROR; @@ -2979,7 +2979,7 @@ rpt_mutex_unlock(&myrpt->lock); ast_copy_string(myrpt->lastlinknode, digitbuf, MAXNODESTR); /* establish call in tranceive mode */ - l = ast_calloc(1, sizeof(struct rpt_link)); + l = ast_calloc(1, sizeof(*l)); if (!l) { ast_log(LOG_WARNING, "Unable to malloc\n"); return DC_ERROR; @@ -6982,7 +6982,7 @@ } else rpt_mutex_unlock(&myrpt->lock); /* establish call in tranceive mode */ - l = ast_calloc(1, sizeof(struct rpt_link)); + l = ast_calloc(1, sizeof(*l)); if (!l) { ast_log(LOG_WARNING, "Unable to malloc\n"); pthread_exit(NULL); Index: apps/app_mixmonitor.c =================================================================== --- apps/app_mixmonitor.c (revision 67164) +++ apps/app_mixmonitor.c (working copy) @@ -220,7 +220,7 @@ if (fs) ast_closestream(fs); - free(mixmonitor); + ast_free(mixmonitor); return NULL; @@ -253,7 +253,7 @@ } /* Pre-allocate mixmonitor structure and spy */ - if (!(mixmonitor = calloc(1, len))) { + if (!(mixmonitor = ast_calloc(1, len))) { return; } @@ -291,7 +291,7 @@ mixmonitor->spy.type, chan->name); /* Since we couldn't add ourselves - bail out! */ ast_mutex_destroy(&mixmonitor->spy.lock); - free(mixmonitor); + ast_free(mixmonitor); return; } Index: apps/app_milliwatt.c =================================================================== --- apps/app_milliwatt.c (revision 67164) +++ apps/app_milliwatt.c (working copy) @@ -59,7 +59,7 @@ static void milliwatt_release(struct ast_channel *chan, void *data) { - free(data); + ast_free(data); return; } Index: apps/app_readfile.c =================================================================== --- apps/app_readfile.c (revision 67164) +++ apps/app_readfile.c (working copy) @@ -94,7 +94,7 @@ ast_log(LOG_WARNING, "%s is longer than %d, and %d \n", file, len, (int)strlen(returnvar)); } pbx_builtin_setvar_helper(chan, varname, returnvar); - free(returnvar); + ast_free(returnvar); } ast_module_user_remove(u); return res; Index: apps/app_meetme.c =================================================================== --- apps/app_meetme.c (revision 67164) +++ apps/app_meetme.c (working copy) @@ -765,7 +765,7 @@ cnf->fd = open("/dev/zap/pseudo", O_RDWR); if (cnf->fd < 0) { ast_log(LOG_WARNING, "Unable to open pseudo device\n"); - free(cnf); + ast_free(cnf); cnf = NULL; goto cnfout; } @@ -780,7 +780,7 @@ ast_hangup(cnf->chan); else close(cnf->fd); - free(cnf); + ast_free(cnf); cnf = NULL; goto cnfout; } @@ -1242,7 +1242,7 @@ else close(conf->fd); - free(conf); + ast_free(conf); return 0; } @@ -2273,7 +2273,7 @@ snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime)); pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs); } - free(user); + ast_free(user); AST_LIST_UNLOCK(&confs); return ret; @@ -3343,9 +3343,9 @@ sla_change_trunk_state(ringing_trunk->trunk, SLA_TRUNK_STATE_IDLE, ALL_TRUNK_REFS, NULL); while ((station_ref = AST_LIST_REMOVE_HEAD(&ringing_trunk->timed_out_stations, entry))) - free(station_ref); + ast_free(station_ref); - free(ringing_trunk); + ast_free(ringing_trunk); } static void sla_stop_ringing_station(struct sla_ringing_station *ringing_station, @@ -3380,7 +3380,7 @@ } done: - free(ringing_station); + ast_free(ringing_station); } static void sla_dial_state_callback(struct ast_dial *dial) @@ -3491,8 +3491,8 @@ args.station = ringing_station->station; args.cond = &cond; args.cond_lock = &cond_lock; - free(ringing_trunk); - free(ringing_station); + ast_free(ringing_trunk); + ast_free(ringing_station); ast_mutex_init(&cond_lock); ast_cond_init(&cond, NULL); ast_mutex_lock(&cond_lock); @@ -3546,7 +3546,7 @@ continue; if (ast_tvdiff_ms(ast_tvnow(), failed_station->last_try) > 1000) { AST_LIST_REMOVE_CURRENT(&sla.failed_stations, entry); - free(failed_station); + ast_free(failed_station); break; } res = 1; @@ -3581,12 +3581,12 @@ if (!sla.attempt_callerid && !ast_strlen_zero(ringing_trunk->trunk->chan->cid.cid_name)) { cid_name = ast_strdupa(ringing_trunk->trunk->chan->cid.cid_name); - free(ringing_trunk->trunk->chan->cid.cid_name); + ast_free(ringing_trunk->trunk->chan->cid.cid_name); ringing_trunk->trunk->chan->cid.cid_name = NULL; } if (!sla.attempt_callerid && !ast_strlen_zero(ringing_trunk->trunk->chan->cid.cid_num)) { cid_num = ast_strdupa(ringing_trunk->trunk->chan->cid.cid_num); - free(ringing_trunk->trunk->chan->cid.cid_num); + ast_free(ringing_trunk->trunk->chan->cid.cid_num); ringing_trunk->trunk->chan->cid.cid_num = NULL; } @@ -3748,7 +3748,7 @@ ast_dial_join(ringing_station->station->dial); ast_dial_destroy(ringing_station->station->dial); ringing_station->station->dial = NULL; - free(ringing_station); + ast_free(ringing_station); } } AST_LIST_TRAVERSE_SAFE_END @@ -4013,7 +4013,7 @@ sla_handle_ringing_trunk_event(); break; } - free(event); + ast_free(event); ast_mutex_lock(&sla.lock); } } @@ -4021,10 +4021,10 @@ ast_mutex_unlock(&sla.lock); while ((ringing_station = AST_LIST_REMOVE_HEAD(&sla.ringing_stations, entry))) - free(ringing_station); + ast_free(ringing_station); while ((failed_station = AST_LIST_REMOVE_HEAD(&sla.failed_stations, entry))) - free(failed_station); + ast_free(failed_station); return NULL; } @@ -4067,12 +4067,12 @@ if (!sla.attempt_callerid && !ast_strlen_zero(trunk_ref->chan->cid.cid_name)) { cid_name = ast_strdupa(trunk_ref->chan->cid.cid_name); - free(trunk_ref->chan->cid.cid_name); + ast_free(trunk_ref->chan->cid.cid_name); trunk_ref->chan->cid.cid_name = NULL; } if (!sla.attempt_callerid && !ast_strlen_zero(trunk_ref->chan->cid.cid_num)) { cid_num = ast_strdupa(trunk_ref->chan->cid.cid_num); - free(trunk_ref->chan->cid.cid_num); + ast_free(trunk_ref->chan->cid.cid_num); trunk_ref->chan->cid.cid_num = NULL; } @@ -4384,7 +4384,7 @@ ast_mutex_unlock(&sla.lock); if (ringing_trunk) { sla_change_trunk_state(ringing_trunk->trunk, SLA_TRUNK_STATE_IDLE, ALL_TRUNK_REFS, NULL); - free(ringing_trunk); + ast_free(ringing_trunk); pbx_builtin_setvar_helper(chan, "SLATRUNK_STATUS", "UNANSWERED"); /* Queue reprocessing of ringing trunks to make stations stop ringing * that shouldn't be ringing after this trunk stopped. */ @@ -4452,10 +4452,10 @@ ast_context_remove_extension(trunk->autocontext, "s", 1, sla_registrar); while ((station_ref = AST_LIST_REMOVE_HEAD(&trunk->stations, entry))) - free(station_ref); + ast_free(station_ref); ast_string_field_free_all(trunk); - free(trunk); + ast_free(trunk); } static void destroy_station(struct sla_station *station) @@ -4478,10 +4478,10 @@ } while ((trunk_ref = AST_LIST_REMOVE_HEAD(&station->trunks, entry))) - free(trunk_ref); + ast_free(trunk_ref); ast_string_field_free_all(station); - free(station); + ast_free(station); } static void sla_destroy(void) @@ -4544,7 +4544,7 @@ if (!(trunk = ast_calloc(1, sizeof(*trunk)))) return -1; if (ast_string_field_init(trunk, 32)) { - free(trunk); + ast_free(trunk); return -1; } @@ -4649,7 +4649,7 @@ } if (!(station_ref = sla_create_station_ref(station))) { - free(trunk_ref); + ast_free(trunk_ref); return; } ast_atomic_fetchadd_int((int *) &trunk->num_stations, 1); @@ -4673,7 +4673,7 @@ if (!(station = ast_calloc(1, sizeof(*station)))) return -1; if (ast_string_field_init(station, 32)) { - free(station); + ast_free(station); return -1; } Index: apps/app_minivm.c =================================================================== --- apps/app_minivm.c (revision 67164) +++ apps/app_minivm.c (working copy) @@ -470,7 +470,7 @@ { struct minivm_template *template; - template = ast_calloc(1, sizeof(struct minivm_template)); + template = ast_calloc(1, sizeof(*template)); if (!template) return NULL; @@ -488,9 +488,9 @@ static void message_template_free(struct minivm_template *template) { if (template->body) - free(template->body); + ast_free(template->body); - free (template); + ast_free (template); } /*! \brief Build message template from configuration */ @@ -524,7 +524,7 @@ ast_copy_string(template->charset, var->value, sizeof(template->charset)); } else if (!strcasecmp(var->name, "templatefile")) { if (template->body) - free(template->body); + ast_free(template->body); template->body = message_template_parse_filebody(var->value); if (!template->body) { ast_log(LOG_ERROR, "Error reading message body definition file %s\n", var->value); @@ -532,7 +532,7 @@ } } else if (!strcasecmp(var->name, "messagebody")) { if (template->body) - free(template->body); + ast_free(template->body); template->body = message_template_parse_emailbody(var->value); if (!template->body) { ast_log(LOG_ERROR, "Error parsing message body definition:\n %s\n", var->value); @@ -727,7 +727,7 @@ { if (vmu->chanvars) ast_variables_destroy(vmu->chanvars); - free(vmu); + ast_free(vmu); } @@ -793,7 +793,7 @@ { struct minivm_account *new; - new = calloc(1, sizeof(struct minivm_account)); + new = ast_calloc(1, sizeof(*new)); if (!new) return NULL; populate_defaults(new); @@ -808,7 +808,7 @@ struct minivm_account *this; AST_LIST_LOCK(&minivm_accounts); while ((this = AST_LIST_REMOVE_HEAD(&minivm_accounts, list))) - free(this); + ast_free(this); AST_LIST_UNLOCK(&minivm_accounts); } @@ -877,7 +877,7 @@ var = ast_load_realtime("minivm", "username", username, "domain", domain, NULL); if (!var) { - free(retval); + ast_free(retval); return NULL; } @@ -2201,7 +2201,7 @@ ast_log(LOG_DEBUG, "Creating static account for user %s domain %s\n", username, domain); /* Allocate user account */ - vmu = ast_calloc(1, sizeof(struct minivm_account)); + vmu = ast_calloc(1, sizeof(*vmu)); if (!vmu) return 0; @@ -2277,7 +2277,7 @@ /*! \brief Free Mini Voicemail timezone */ static void free_zone(struct minivm_zone *z) { - free(z); + ast_free(z); } /*! \brief Clear list of timezones */ @@ -2299,21 +2299,21 @@ struct minivm_zone *newzone; char *msg_format, *timezone; - newzone = ast_calloc(1, sizeof(struct minivm_zone)); + newzone = ast_calloc(1, sizeof(*newzone)); if (newzone == NULL) return 0; msg_format = ast_strdupa(config); if (msg_format == NULL) { ast_log(LOG_WARNING, "Out of memory.\n"); - free(newzone); + ast_free(newzone); return 0; } timezone = strsep(&msg_format, "|"); if (!msg_format) { ast_log(LOG_WARNING, "Invalid timezone definition : %s\n", zonename); - free(newzone); + ast_free(newzone); return 0; } Index: apps/app_macro.c =================================================================== --- apps/app_macro.c (revision 67164) +++ apps/app_macro.c (working copy) @@ -422,7 +422,7 @@ if (oldargs[x]) { if (!dead) pbx_builtin_setvar_helper(chan, varname, oldargs[x]); - free(oldargs[x]); + ast_free(oldargs[x]); } else if (!dead) { pbx_builtin_setvar_helper(chan, varname, NULL); } @@ -435,11 +435,11 @@ pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority); } if (save_macro_exten) - free(save_macro_exten); + ast_free(save_macro_exten); if (save_macro_context) - free(save_macro_context); + ast_free(save_macro_context); if (save_macro_priority) - free(save_macro_priority); + ast_free(save_macro_priority); if (!dead && setmacrocontext) { chan->macrocontext[0] = '\0'; @@ -470,7 +470,7 @@ if (!dead) pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset); if (save_macro_offset) - free(save_macro_offset); + ast_free(save_macro_offset); /* Unlock the macro */ if (exclusive) { Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 67164) +++ apps/app_voicemail.c (working copy) @@ -797,7 +797,7 @@ ast_variables_destroy(var); } else { if (!ivm) - free(retval); + ast_free(retval); retval = NULL; } } @@ -2293,12 +2293,12 @@ if (!ast_test_flag(vmu, VM_ALLOCED)) return; - free(vmu); + ast_free(vmu); } static void free_zone(struct vm_zone *z) { - free(z); + ast_free(z); } static const char *mbox(int id) @@ -8034,10 +8034,9 @@ AST_LIST_UNLOCK(&zones); } else { ast_log(LOG_WARNING, "Invalid timezone definition at line %d\n", var->lineno); - free(z); + ast_free(z); } } else { - free(z); AST_LIST_UNLOCK(&users); ast_config_destroy(cfg); return -1; @@ -8053,19 +8052,19 @@ memset(emailtitle,0,sizeof(emailtitle)); strcpy(charset, "ISO-8859-1"); if (emailbody) { - free(emailbody); + ast_free(emailbody); emailbody = NULL; } if (emailsubject) { - free(emailsubject); + ast_free(emailsubject); emailsubject = NULL; } if (pagerbody) { - free(pagerbody); + ast_free(pagerbody); pagerbody = NULL; } if (pagersubject) { - free(pagersubject); + ast_free(pagersubject); pagersubject = NULL; } if ((s = ast_variable_retrieve(cfg, "general", "pbxskip"))) @@ -8925,7 +8924,7 @@ ast_variables_destroy(var); return vmu; } else { - free(vmu); + ast_free(vmu); return NULL; } } @@ -9305,7 +9304,7 @@ AST_LIST_UNLOCK(&vmstates); if (vc) - free(vc); + ast_free(vc); else ast_log(LOG_ERROR, "No vmstate found for user:%s, mailbox %s\n", vms->imapuser, vms->username); } Index: apps/app_dial.c =================================================================== --- apps/app_dial.c (revision 67164) +++ apps/app_dial.c (working copy) @@ -312,7 +312,7 @@ ast_hangup(outgoing->chan); oo = outgoing; outgoing=outgoing->next; - free(oo); + ast_free(oo); } } @@ -1327,7 +1327,7 @@ handle_cause(cause, &num); if (!rest) /* we are on the last destination */ chan->hangupcause = cause; - free(tmp); + ast_free(tmp); continue; } pbx_builtin_setvar_helper(tc, "DIALEDPEERNUMBER", numsubst); @@ -1374,7 +1374,7 @@ } if (!tc) { handle_cause(cause, &num); - free(tmp); + ast_free(tmp); continue; } } @@ -1436,7 +1436,7 @@ ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst); ast_hangup(tc); tc = NULL; - free(tmp); + ast_free(tmp); continue; } else { senddialevent(chan, tc); Index: apps/app_speech_utils.c =================================================================== --- apps/app_speech_utils.c (revision 67164) +++ apps/app_speech_utils.c (working copy) @@ -511,7 +511,7 @@ } if (speech->processing_sound != NULL) { - free(speech->processing_sound); + ast_free(speech->processing_sound); speech->processing_sound = NULL; } Index: apps/app_osplookup.c =================================================================== --- apps/app_osplookup.c (revision 67164) +++ apps/app_osplookup.c (working copy) @@ -328,7 +328,7 @@ error = OSPPUtilLoadPEMPrivateKey((unsigned char*)p->privatekey, &privatekey); if (error != OSPC_ERR_NO_ERROR) { ast_log(LOG_WARNING, "OSP: Unable to load privatekey '%s', error '%d'\n", p->privatekey, error); - free(p); + ast_free(p); return 0; } @@ -336,9 +336,9 @@ if (error != OSPC_ERR_NO_ERROR) { ast_log(LOG_WARNING, "OSP: Unable to load localcert '%s', error '%d'\n", p->localcert, error); if (privatekey.PrivateKeyData) { - free(privatekey.PrivateKeyData); + ast_free(privatekey.PrivateKeyData); } - free(p); + ast_free(p); return 0; } @@ -354,16 +354,16 @@ ast_log(LOG_WARNING, "OSP: Unable to load cacert '%s', error '%d'\n", p->cacerts[i], error); for (j = 0; j < i; j++) { if (cacerts[j].CertData) { - free(cacerts[j].CertData); + ast_free(cacerts[j].CertData); } } if (localcert.CertData) { - free(localcert.CertData); + ast_free(localcert.CertData); } if (privatekey.PrivateKeyData) { - free(privatekey.PrivateKeyData); + ast_free(privatekey.PrivateKeyData); } - free(p); + ast_free(p); return 0; } pcacerts[i] = &cacerts[i]; @@ -394,7 +394,7 @@ &p->handle); if (error != OSPC_ERR_NO_ERROR) { ast_log(LOG_WARNING, "OSP: Unable to create provider '%s', error '%d'\n", provider, error); - free(p); + ast_free(p); res = -1; } else { if (option_debug) @@ -408,14 +408,14 @@ for (i = 0; i < p->cacount; i++) { if (cacerts[i].CertData) { - free(cacerts[i].CertData); + ast_free(cacerts[i].CertData); } } if (localcert.CertData) { - free(localcert.CertData); + ast_free(localcert.CertData); } if (privatekey.PrivateKeyData) { - free(privatekey.PrivateKeyData); + ast_free(privatekey.PrivateKeyData); } return res; @@ -2009,7 +2009,7 @@ while(p) { next = p->next; OSPPProviderDelete(p->handle, 0); - free(p); + ast_free(p); p = next; } ospproviders = NULL; Index: apps/app_externalivr.c =================================================================== --- apps/app_externalivr.c (revision 67164) +++ apps/app_externalivr.c (working copy) @@ -136,7 +136,7 @@ struct gen_state *state = data; gen_closestream(state); - free(data); + ast_free(data); } /* caller has the playlist locked */ @@ -399,7 +399,7 @@ AST_LIST_LOCK(&u->finishlist); while ((entry = AST_LIST_REMOVE_HEAD(&u->finishlist, list))) { send_child_event(child_events, 'F', entry->filename, chan); - free(entry); + ast_free(entry); } AST_LIST_UNLOCK(&u->finishlist); } @@ -422,7 +422,7 @@ AST_LIST_LOCK(&u->playlist); while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) { send_child_event(child_events, 'D', entry->filename, chan); - free(entry); + ast_free(entry); } if (!u->playing_silence) u->abort_current_sound = 1; @@ -467,7 +467,7 @@ AST_LIST_LOCK(&u->playlist); while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) { send_child_event(child_events, 'D', entry->filename, chan); - free(entry); + ast_free(entry); } if (!u->playing_silence) u->abort_current_sound = 1; @@ -569,7 +569,7 @@ close(child_stderr[1]); while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) - free(entry); + ast_free(entry); ast_module_user_remove(lu); Index: apps/app_directory.c =================================================================== --- apps/app_directory.c (revision 67164) +++ apps/app_directory.c (working copy) @@ -463,14 +463,14 @@ if (!strncmp(conv, ext, strlen(ext))) { /* Match! */ found++; - free(conv); - free(start); + ast_free(conv); + ast_free(start); break; } - free(conv); + ast_free(conv); } } - free(start); + ast_free(start); } v = v->next; } @@ -547,10 +547,10 @@ default: break; } - free(conv); + ast_free(conv); break; } - free(conv); + ast_free(conv); } } } Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 67164) +++ apps/app_queue.c (working copy) @@ -831,7 +831,7 @@ if (option_debug) ast_log(LOG_DEBUG, "Removing %s from the list of interfaces that make up all of our queue members.\n", interface); AST_LIST_REMOVE_CURRENT(&interfaces, list); - free(curint); + ast_free(curint); } break; } @@ -848,7 +848,7 @@ AST_LIST_LOCK(&interfaces); while ((curint = AST_LIST_REMOVE_HEAD(&interfaces, list))) - free(curint); + ast_free(curint); AST_LIST_UNLOCK(&interfaces); } @@ -1076,7 +1076,7 @@ else q->members = next; remove_from_interfaces(curm->interface); - free(curm); + ast_free(curm); } else prev = curm; } @@ -1086,7 +1086,7 @@ { free_members(q, 1); ast_mutex_destroy(&q->lock); - free(q); + ast_free(q); } /*!\brief Reload a single queue via realtime. @@ -1196,7 +1196,7 @@ q->members = next_m; } remove_from_interfaces(m->interface); - free(m); + ast_free(m); } else { prev_m = m; } @@ -1546,7 +1546,7 @@ ast_hangup(outgoing->chan); oo = outgoing; outgoing = outgoing->q_next; - free(oo); + ast_free(oo); } } @@ -1747,13 +1747,13 @@ tmp->chan->data = "(Outgoing Line)"; tmp->chan->whentohangup = 0; if (tmp->chan->cid.cid_num) - free(tmp->chan->cid.cid_num); + ast_free(tmp->chan->cid.cid_num); tmp->chan->cid.cid_num = ast_strdup(qe->chan->cid.cid_num); if (tmp->chan->cid.cid_name) - free(tmp->chan->cid.cid_name); + ast_free(tmp->chan->cid.cid_name); tmp->chan->cid.cid_name = ast_strdup(qe->chan->cid.cid_name); if (tmp->chan->cid.cid_ani) - free(tmp->chan->cid.cid_ani); + ast_free(tmp->chan->cid.cid_ani); tmp->chan->cid.cid_ani = ast_strdup(qe->chan->cid.cid_ani); /* Inherit specially named variables from parent channel */ @@ -2067,11 +2067,11 @@ } else { ast_channel_inherit_variables(in, o->chan); if (o->chan->cid.cid_num) - free(o->chan->cid.cid_num); + ast_free(o->chan->cid.cid_num); o->chan->cid.cid_num = ast_strdup(in->cid.cid_num); if (o->chan->cid.cid_name) - free(o->chan->cid.cid_name); + ast_free(o->chan->cid.cid_name); o->chan->cid.cid_name = ast_strdup(in->cid.cid_name); ast_string_field_set(o->chan, accountcode, in->accountcode); @@ -2079,11 +2079,11 @@ if (in->cid.cid_ani) { if (o->chan->cid.cid_ani) - free(o->chan->cid.cid_ani); + ast_free(o->chan->cid.cid_ani); o->chan->cid.cid_ani = ast_strdup(in->cid.cid_ani); } if (o->chan->cid.cid_rdnis) - free(o->chan->cid.cid_rdnis); + ast_free(o->chan->cid.cid_rdnis); o->chan->cid.cid_rdnis = ast_strdup(S_OR(in->macroexten, in->exten)); if (ast_call(o->chan, tmpchan, 0)) { ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan); @@ -2547,7 +2547,7 @@ if (outgoing->chan && (outgoing->chan->_state == AST_STATE_UP)) break; } else { - free(tmp); + ast_free(tmp); } } if (qe->expire && (!qe->parent->timeout || (qe->expire - now) <= qe->parent->timeout)) @@ -2964,7 +2964,7 @@ "Location: %s\r\n" "MemberName: %s\r\n", q->name, last_member->interface, last_member->membername); - free(last_member); + ast_free(last_member); if (queue_persistent_members) dump_queue_members(q); @@ -4087,7 +4087,7 @@ } else { q->members = newm; } - free(cur); + ast_free(cur); } else { /* Add them to the master int list if necessary */ add_to_interfaces(interface); @@ -4116,7 +4116,7 @@ q->members = next; remove_from_interfaces(cur->interface); - free(cur); + ast_free(cur); } if (new) { Index: apps/app_followme.c =================================================================== --- apps/app_followme.c (revision 67164) +++ apps/app_followme.c (working copy) @@ -172,17 +172,17 @@ while ((prev = AST_LIST_REMOVE_HEAD(&f->numbers, entry))) /* Free the number */ - free(prev); + ast_free(prev); AST_LIST_HEAD_INIT_NOLOCK(&f->numbers); while ((prev = AST_LIST_REMOVE_HEAD(&f->blnumbers, entry))) /* Free the blacklisted number */ - free(prev); + ast_free(prev); AST_LIST_HEAD_INIT_NOLOCK(&f->blnumbers); while ((prev = AST_LIST_REMOVE_HEAD(&f->wlnumbers, entry))) /* Free the whitelisted number */ - free(prev); + ast_free(prev); AST_LIST_HEAD_INIT_NOLOCK(&f->wlnumbers); } @@ -815,7 +815,7 @@ tmpuser = ast_calloc(1, sizeof(*tmpuser)); if (!tmpuser) { ast_log(LOG_WARNING, "Out of memory!\n"); - free(findme_user_list); + ast_free(findme_user_list); return; } @@ -872,7 +872,7 @@ if (!fmuser->cleared && fmuser->ochan != winner) clear_caller(fmuser); AST_LIST_REMOVE_CURRENT(findme_user_list, entry); - free(fmuser); + ast_free(fmuser); } AST_LIST_TRAVERSE_SAFE_END fmuser = NULL; @@ -883,7 +883,7 @@ if (!caller) { tpargs->status = 1; - free(findme_user_list); + ast_free(findme_user_list); return; } @@ -893,7 +893,7 @@ break; } - free(findme_user_list); + ast_free(findme_user_list); if (!winner) tpargs->status = 1; else { @@ -1012,7 +1012,7 @@ AST_LIST_TRAVERSE_SAFE_BEGIN(&targs.cnumbers, nm, entry) { AST_LIST_REMOVE_CURRENT(&targs.cnumbers, entry); - free(nm); + ast_free(nm); } AST_LIST_TRAVERSE_SAFE_END @@ -1075,7 +1075,7 @@ AST_LIST_LOCK(&followmes); while ((f = AST_LIST_REMOVE_HEAD(&followmes, entry))) { free_numbers(f); - free(f); + ast_free(f); } AST_LIST_UNLOCK(&followmes);