aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/pbx_dundi.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-30 05:07:52 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-30 05:07:52 +0000
commited1caa71f41b5b761d40656c42a55c9ab12f16b1 (patch)
tree36c5640c461a45ad6833f3121a5fa7e1a20b46fb /pbx/pbx_dundi.c
parent4a493cac7dfbda2e8bf035baf602c2fc657b4717 (diff)
immediately handle ast_strdupa result so that one more level of indentation
can be removed from this function git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23490 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_dundi.c')
-rw-r--r--pbx/pbx_dundi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 68aca1c7d..a03ecfd2c 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -3984,8 +3984,10 @@ static void build_mapping(char *name, char *value)
struct dundi_mapping *map;
int x;
int y;
- t = ast_strdupa(value);
- if (t) {
+
+ if (!(t = ast_strdupa(value)))
+ return;
+
AST_LIST_TRAVERSE(&mappings, map, list) {
/* Find a double match */
if (!strcasecmp(map->dcontext, name) &&
@@ -4044,7 +4046,6 @@ static void build_mapping(char *name, char *value)
}
} else
ast_log(LOG_WARNING, "Expected at least %d arguments in map, but got only %d\n", 4, x);
- }
}
/* \note Called with the peers list already locked */