(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
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@401661
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
contactptr = AST_LIST_NEXT(contactptr,list);
}
+
+ while ((contactptr = AST_LIST_REMOVE_HEAD(contactlistptr,list))) {
+ ast_free(contactptr);
+ }
}
}
res = AST_TEST_FAIL;
}
+ ast_free(expr);
+ ast_free(result);
+
return res;
}
#endif
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) {
} else
temp = NULL;
closedir(dir);
+ free(filename);
+ free(dirname);
return (temp);
}
return 0;
}
+static void test_shutdown(void)
+{
+ ast_cli_unregister_multiple(test_cli, ARRAY_LEN(test_cli));
+}
+
#endif /* TEST_FRAMEWORK */
int ast_test_init()
#ifdef TEST_FRAMEWORK
/* Register cli commands */
ast_cli_register_multiple(test_cli, ARRAY_LEN(test_cli));
+ ast_register_atexit(test_shutdown);
#endif
return 0;
if (e == b) {
AST_DLLIST_REMOVE_CURRENT(list); /* C A */
+ free(b);
print_list(tc, "C <=> A");
}
if (e == a) {
AST_DLLIST_TRAVERSE_SAFE_END;
print_list(tc, "C <=> A <=> D");
+ destroy_test_container(tc);
}
static int unload_module(void)