mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
Conversions of free to ast_free, where applicable, and several other formatting fixes.
Reported by: eliel Patch by: eliel,tilghman (Closes issue #11209) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -395,7 +395,7 @@ static void handle_cause(int cause, struct cause_args *num)
|
||||
#define S_REPLACE(s, new_val) \
|
||||
do { \
|
||||
if (s) \
|
||||
free(s); \
|
||||
ast_free(s); \
|
||||
s = (new_val); \
|
||||
} while (0)
|
||||
|
||||
@@ -1146,7 +1146,8 @@ static int setup_privacy_args(struct privacy_args *pa,
|
||||
|
||||
ast_copy_string(pa->privcid, l, sizeof(pa->privcid));
|
||||
|
||||
if( strncmp(pa->privcid,"NOCALLERID",10) != 0 && ast_test_flag64(opts, OPT_SCREEN_NOCLID) ) { /* if callerid is set, and ast_test_flag64(&opts, OPT_SCREEN_NOCLID) is set also */
|
||||
if (strncmp(pa->privcid, "NOCALLERID", 10) != 0 && ast_test_flag64(opts, OPT_SCREEN_NOCLID)) {
|
||||
/* if callerid is set, and OPT_SCREEN_NOCLID is set also */
|
||||
if (option_verbose > 2)
|
||||
ast_verbose(VERBOSE_PREFIX_3 "CallerID set (%s); N option set; Screening should be off\n", pa->privcid);
|
||||
pa->privdb_val = AST_PRIVACY_ALLOW;
|
||||
@@ -1224,7 +1225,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
char numsubst[256];
|
||||
char cidname[AST_MAX_EXTENSION] = "";
|
||||
|
||||
struct ast_bridge_config config;
|
||||
struct ast_bridge_config config = { { 0, } };
|
||||
unsigned int calldurationlimit = 0;
|
||||
char *dtmfcalled = NULL, *dtmfcalling = NULL;
|
||||
struct privacy_args pa = {
|
||||
@@ -1259,8 +1260,6 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
|
||||
AST_STANDARD_APP_ARGS(args, parse);
|
||||
|
||||
memset(&config,0,sizeof(struct ast_bridge_config));
|
||||
|
||||
if (!ast_strlen_zero(args.options) &&
|
||||
ast_app_parse_options64(dial_exec_options, &opts, opt_args, args.options)) {
|
||||
pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
|
||||
@@ -1364,14 +1363,14 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
else {
|
||||
if (!(datastore = ast_channel_datastore_alloc(&dialed_interface_info, NULL))) {
|
||||
ast_log(LOG_WARNING, "Unable to create channel datastore for dialed interfaces. Aborting!\n");
|
||||
free(tmp);
|
||||
ast_free(tmp);
|
||||
goto out;
|
||||
}
|
||||
|
||||
datastore->inheritance = DATASTORE_INHERIT_FOREVER;
|
||||
|
||||
if (!(dialed_interfaces = ast_calloc(1, sizeof(*dialed_interfaces)))) {
|
||||
free(tmp);
|
||||
ast_free(tmp);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1395,7 +1394,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
|
||||
if (di) {
|
||||
fulldial++;
|
||||
free(tmp);
|
||||
ast_free(tmp);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1406,7 +1405,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
if (strcasecmp(tech, "Local")) {
|
||||
if (!(di = ast_calloc(1, sizeof(*di) + strlen(interface)))) {
|
||||
AST_LIST_UNLOCK(dialed_interfaces);
|
||||
free(tmp);
|
||||
ast_free(tmp);
|
||||
goto out;
|
||||
}
|
||||
strcpy(di->interface, interface);
|
||||
@@ -1715,7 +1714,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
if (gosub_args) {
|
||||
res = pbx_exec(peer, theapp, gosub_args);
|
||||
ast_pbx_run(peer);
|
||||
free(gosub_args);
|
||||
ast_free(gosub_args);
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "Gosub exited with status %d\n", res);
|
||||
} else
|
||||
@@ -1824,14 +1823,17 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
||||
goto done;
|
||||
}
|
||||
if (opermode && !strncmp(chan->name, "Zap", 3) && !strncmp(peer->name, "Zap", 3)) {
|
||||
/* XXX what's this special handling for Zap <-> Zap ? */
|
||||
/* what's this special handling for Zap <-> Zap ?
|
||||
* A: Zap to Zap calls are natively bridged at the kernel driver
|
||||
* level, so we need to ensure that this mode gets propagated
|
||||
* all the way down. */
|
||||
struct oprmode oprmode;
|
||||
|
||||
oprmode.peer = peer;
|
||||
oprmode.mode = opermode;
|
||||
|
||||
ast_channel_setoption(chan,
|
||||
AST_OPTION_OPRMODE,&oprmode,sizeof(struct oprmode),0);
|
||||
AST_OPTION_OPRMODE, &oprmode, sizeof(oprmode), 0);
|
||||
}
|
||||
res = ast_bridge_call(chan, peer, &config);
|
||||
end_time = time(NULL);
|
||||
|
@@ -252,7 +252,7 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename
|
||||
|
||||
/* Setup the actual spy before creating our thread */
|
||||
if (ast_audiohook_init(&mixmonitor->audiohook, AST_AUDIOHOOK_TYPE_SPY, mixmonitor_spy_type)) {
|
||||
free(mixmonitor);
|
||||
ast_free(mixmonitor);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -285,7 +285,7 @@ static struct logchannel *make_logchannel(const char *channel, const char *compo
|
||||
|
||||
if (0 > chan->facility) {
|
||||
fprintf(stderr, "Logger Warning: bad syslog facility in logger.conf\n");
|
||||
free(chan);
|
||||
ast_free(chan);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ static void init_logger_chain(int reload, int locked)
|
||||
if (!locked)
|
||||
AST_RWLIST_WRLOCK(&logchannels);
|
||||
while ((chan = AST_RWLIST_REMOVE_HEAD(&logchannels, list)))
|
||||
free(chan);
|
||||
ast_free(chan);
|
||||
if (!locked)
|
||||
AST_RWLIST_UNLOCK(&logchannels);
|
||||
|
||||
@@ -882,7 +882,7 @@ static void *logger_thread(void *data)
|
||||
logger_print_verbose(msg);
|
||||
|
||||
/* Free the data since we are done */
|
||||
free(msg);
|
||||
ast_free(msg);
|
||||
}
|
||||
|
||||
/* If we should stop, then stop */
|
||||
@@ -1060,7 +1060,7 @@ void ast_log(int level, const char *file, int line, const char *function, const
|
||||
AST_LIST_UNLOCK(&logmsgs);
|
||||
} else {
|
||||
logger_print_normal(logmsg);
|
||||
free(logmsg);
|
||||
ast_free(logmsg);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -1089,7 +1089,7 @@ void ast_backtrace(void)
|
||||
} else {
|
||||
ast_debug(1, "Could not allocate memory for backtrace\n");
|
||||
}
|
||||
free(addresses);
|
||||
ast_free(addresses);
|
||||
}
|
||||
#else
|
||||
ast_log(LOG_WARNING, "Must run configure with '--enable-dev-mode' for stack backtraces.\n");
|
||||
@@ -1150,7 +1150,7 @@ void ast_verbose(const char *fmt, ...)
|
||||
AST_LIST_UNLOCK(&logmsgs);
|
||||
} else {
|
||||
logger_print_verbose(logmsg);
|
||||
free(logmsg);
|
||||
ast_free(logmsg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1178,7 +1178,7 @@ int ast_unregister_verbose(void (*v)(const char *string))
|
||||
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&verbosers, cur, list) {
|
||||
if (cur->verboser == v) {
|
||||
AST_RWLIST_REMOVE_CURRENT(list);
|
||||
free(cur);
|
||||
ast_free(cur);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -790,7 +790,7 @@ static char *handle_show_locks(struct ast_cli_entry *e, int cmd, struct ast_cli_
|
||||
|
||||
ast_cli(a->fd, "%s", str->str);
|
||||
|
||||
free(str);
|
||||
ast_free(str);
|
||||
|
||||
return CLI_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user