summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-01-21 20:57:06 +0000
committerRussell Bryant <russell@russellbryant.com>2006-01-21 20:57:06 +0000
commit4414f453939519e89787a7dfd18c3390e2162775 (patch)
treefca85df85af6ced3fcc170993dda57b4be818254 /channels
parent41c87ccb9771093503cf4d3e52ccb624fa40742e (diff)
on this pass, only remove duplicate log messages
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_agent.c11
-rw-r--r--channels/chan_iax2.c9
-rw-r--r--channels/chan_sip.c20
3 files changed, 9 insertions, 31 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 68652b1e7..d9c4b8697 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -328,11 +328,8 @@ static struct agent_pvt *add_agent(char *agent, int pending)
char *agt = NULL;
struct agent_pvt *p, *prev;
- parse = ast_strdupa(agent);
- if (!parse) {
- ast_log(LOG_ERROR, "Out of memory!\n");
+ if (!(parse = ast_strdupa(agent)))
return NULL;
- }
/* Extract username (agt), password and name from agent (args). */
AST_NONSTANDARD_APP_ARGS(args, parse, ',');
@@ -1768,7 +1765,6 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
LOCAL_USER_ADD(u);
if (!(parse = ast_strdupa(data))) {
- ast_log(LOG_ERROR, "Out of memory!\n");
LOCAL_USER_REMOVE(u);
return -1;
}
@@ -2510,11 +2506,8 @@ static char *function_agent(struct ast_channel *chan, char *cmd, char *data, cha
return buf;
}
- item = ast_strdupa(data);
- if (!item) {
- ast_log(LOG_ERROR, "Out of memory!\n");
+ if (!(item = ast_strdupa(data)))
return buf;
- }
agentid = strsep(&item, ":");
if (!item)
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 6238366c8..b5be2e3da 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -8033,11 +8033,8 @@ static int peer_set_srcaddr(struct iax2_peer *peer, const char *srcaddr)
char *addr;
char *portstr;
- tmp = ast_strdupa(srcaddr);
- if (!tmp) {
- ast_log(LOG_WARNING, "Out of memory!\n");
+ if (!(tmp = ast_strdupa(srcaddr)))
return -1;
- }
addr = strsep(&tmp, ":");
portstr = tmp;
@@ -9174,10 +9171,8 @@ static char *function_iaxpeer(struct ast_channel *chan, char *cmd, char *data, c
char *peername, *colname;
char iabuf[INET_ADDRSTRLEN];
- if (!(peername = ast_strdupa(data))) {
- ast_log(LOG_ERROR, "Memory Error!\n");
+ if (!(peername = ast_strdupa(data)))
return ret;
- }
/* if our channel, return the IP address of the endpoint of current channel */
if (!strcmp(peername,"CURRENTCHANNEL")) {
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index fd78084b1..dc0df0d87 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9292,10 +9292,8 @@ static char *function_sippeer(struct ast_channel *chan, char *cmd, char *data, c
char *peername, *colname;
char iabuf[INET_ADDRSTRLEN];
- if (!(peername = ast_strdupa(data))) {
- ast_log(LOG_ERROR, "Memory Error!\n");
+ if (!(peername = ast_strdupa(data)))
return ret;
- }
if ((colname = strchr(peername, ':'))) {
*colname = '\0';
@@ -12847,11 +12845,9 @@ static int sip_sipredirect(struct sip_pvt *p, const char *dest)
char *extension, *host, *port;
char tmp[80];
- cdest = ast_strdupa(dest);
- if (!cdest) {
- ast_log(LOG_ERROR, "Problem allocating the memory\n");
+ if (!(cdest = ast_strdupa(dest)))
return 0;
- }
+
extension = strsep(&cdest, "@");
host = strsep(&cdest, ":");
port = strsep(&cdest, ":");
@@ -12879,17 +12875,11 @@ static int sip_sipredirect(struct sip_pvt *p, const char *dest)
ast_log(LOG_ERROR, "Can't find the host address\n");
return 0;
}
- host = ast_strdupa(lhost);
- if (!host) {
- ast_log(LOG_ERROR, "Problem allocating the memory\n");
+ if (!(host = ast_strdupa(lhost)))
return 0;
- }
if (!ast_strlen_zero(lport)) {
- port = ast_strdupa(lport);
- if (!port) {
- ast_log(LOG_ERROR, "Problem allocating the memory\n");
+ if (!(port = ast_strdupa(lport)))
return 0;
- }
}
}
}