[asterisk-commits] jrose: branch 12 r401662 - in /branches/12: ./ channels/sip/ funcs/ main/ mai...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Oct 23 15:02:23 CDT 2013
Author: jrose
Date: Wed Oct 23 15:02:21 2013
New Revision: 401662
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=401662
Log:
memory leaks: Memory leak cleanup patch by Corey Farrell (first set)
(issue ASTERSIK-22467)
Reported by: Corey Farrell
Patches:
chan_sip-parse_contact_header_test-free-contacts.patch uploaded by coreyfarrell (license 5909)
cli-filename-completion-leak.patch uploaded by coreyfarrell (license 5909)
func_math.patch uploaded by corefarrell (license 5909)
main-test-cleanup.patch uploaded by coreyfarrell (license 5909)
test_dlinklists.patch uploaded by coreyfarrell (license 5909)
........
Merged revisions 401660 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 401661 from http://svn.asterisk.org/svn/asterisk/branches/11
Modified:
branches/12/ (props changed)
branches/12/channels/sip/reqresp_parser.c
branches/12/funcs/func_math.c
branches/12/main/editline/readline.c
branches/12/main/test.c
branches/12/tests/test_dlinklists.c
Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Modified: branches/12/channels/sip/reqresp_parser.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/sip/reqresp_parser.c?view=diff&rev=401662&r1=401661&r2=401662
==============================================================================
--- branches/12/channels/sip/reqresp_parser.c (original)
+++ branches/12/channels/sip/reqresp_parser.c Wed Oct 23 15:02:21 2013
@@ -1561,6 +1561,10 @@
}
contactptr = AST_LIST_NEXT(contactptr,list);
+ }
+
+ while ((contactptr = AST_LIST_REMOVE_HEAD(contactlistptr,list))) {
+ ast_free(contactptr);
}
}
}
Modified: branches/12/funcs/func_math.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/funcs/func_math.c?view=diff&rev=401662&r1=401661&r2=401662
==============================================================================
--- branches/12/funcs/func_math.c (original)
+++ branches/12/funcs/func_math.c Wed Oct 23 15:02:21 2013
@@ -503,6 +503,9 @@
res = AST_TEST_FAIL;
}
+ ast_free(expr);
+ ast_free(result);
+
return res;
}
#endif
Modified: branches/12/main/editline/readline.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/editline/readline.c?view=diff&rev=401662&r1=401661&r2=401662
==============================================================================
--- branches/12/main/editline/readline.c (original)
+++ branches/12/main/editline/readline.c Wed Oct 23 15:02:21 2013
@@ -1236,8 +1236,11 @@
filename_len = strlen(filename);
dir = opendir(dirname ? dirname : ".");
- if (!dir)
+ if (!dir) {
+ free(filename);
+ free(dirname);
return (NULL); /* cannot open the directory */
+ }
/* find the match */
while ((entry = readdir(dir)) != NULL) {
@@ -1274,6 +1277,8 @@
} else
temp = NULL;
closedir(dir);
+ free(filename);
+ free(dirname);
return (temp);
}
Modified: branches/12/main/test.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/test.c?view=diff&rev=401662&r1=401661&r2=401662
==============================================================================
--- branches/12/main/test.c (original)
+++ branches/12/main/test.c Wed Oct 23 15:02:21 2013
@@ -1053,6 +1053,7 @@
static void test_cleanup(void)
{
+ ast_cli_unregister_multiple(test_cli, ARRAY_LEN(test_cli));
ao2_cleanup(test_suite_topic);
test_suite_topic = NULL;
STASIS_MESSAGE_TYPE_CLEANUP(ast_test_suite_message_type);
Modified: branches/12/tests/test_dlinklists.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/tests/test_dlinklists.c?view=diff&rev=401662&r1=401661&r2=401662
==============================================================================
--- branches/12/tests/test_dlinklists.c (original)
+++ branches/12/tests/test_dlinklists.c Wed Oct 23 15:02:21 2013
@@ -337,6 +337,7 @@
if (e == b) {
AST_DLLIST_REMOVE_CURRENT(list); /* C A */
+ free(b);
print_list(tc, "C <=> A");
}
if (e == a) {
@@ -348,6 +349,7 @@
AST_DLLIST_TRAVERSE_SAFE_END;
print_list(tc, "C <=> A <=> D");
+ destroy_test_container(tc);
}
static int unload_module(void)
More information about the asterisk-commits
mailing list