[asterisk-commits] file: trunk r53359 - in /trunk: ./
channels/chan_iax2.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Feb 7 08:46:31 MST 2007
Author: file
Date: Wed Feb 7 09:46:30 2007
New Revision: 53359
URL: http://svn.digium.com/view/asterisk?view=rev&rev=53359
Log:
Merged revisions 53358 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r53358 | file | 2007-02-07 10:43:39 -0500 (Wed, 07 Feb 2007) | 10 lines
Merged revisions 53357 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r53357 | file | 2007-02-07 10:38:48 -0500 (Wed, 07 Feb 2007) | 2 lines
Fix a few potential memory leaks with realtime users and peers. (issue #8999 reported by bsmithurst)
........
................
Modified:
trunk/ (props changed)
trunk/channels/chan_iax2.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=53359&r1=53358&r2=53359
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Wed Feb 7 09:46:30 2007
@@ -2540,8 +2540,10 @@
peer = build_peer(peername, var, NULL, ast_test_flag((&globalflags), IAX_RTCACHEFRIENDS) ? 0 : 1);
- if (!peer)
+ if (!peer) {
+ ast_variables_destroy(var);
return NULL;
+ }
for (tmp = var; tmp; tmp = tmp->next) {
/* Make sure it's not a user only... */
@@ -2564,10 +2566,11 @@
dynamic = 1;
}
}
+
+ ast_variables_destroy(var);
+
if (!peer)
return NULL;
-
- ast_variables_destroy(var);
if (ast_test_flag((&globalflags), IAX_RTCACHEFRIENDS)) {
ast_copy_flags(peer, &globalflags, IAX_RTAUTOCLEAR|IAX_RTCACHEFRIENDS);
@@ -2627,10 +2630,11 @@
}
user = build_user(username, var, NULL, !ast_test_flag((&globalflags), IAX_RTCACHEFRIENDS));
+
+ ast_variables_destroy(var);
+
if (!user)
return NULL;
-
- ast_variables_destroy(var);
if (ast_test_flag((&globalflags), IAX_RTCACHEFRIENDS)) {
ast_set_flag(user, IAX_RTCACHEFRIENDS);
@@ -4855,16 +4859,14 @@
*key = '\0';
key++;
}
- if (!key || ast_db_get(family, key, buf, sizeof(buf))) {
+ if (!key || ast_db_get(family, key, buf, sizeof(buf)))
ast_log(LOG_WARNING, "Unable to retrieve database password for family/key '%s'!\n", user->dbsecret);
- if (ast_test_flag(user, IAX_TEMPONLY)) {
- destroy_user(user);
- user = NULL;
- }
- } else
+ else
ast_string_field_set(iaxs[callno], secret, buf);
} else
ast_string_field_set(iaxs[callno], secret, user->secret);
+ if (ast_test_flag(user, IAX_TEMPONLY))
+ destroy_user(user);
res = 0;
}
ast_set2_flag(iaxs[callno], iax2_getpeertrunk(*sin), IAX_TRUNK);
More information about the asterisk-commits
mailing list