diff --git a/channels/sip/reqresp_parser.c b/channels/sip/reqresp_parser.c
index ac986aa59523df9458ddad3e73b2923b4c477d83..7d4445784ae2c8ddbba7fd9f06bd9505f6669563 100644
--- a/channels/sip/reqresp_parser.c
+++ b/channels/sip/reqresp_parser.c
@@ -1562,6 +1562,10 @@ AST_TEST_DEFINE(parse_contact_header_test)
 
 				contactptr = AST_LIST_NEXT(contactptr,list);
 			}
+
+			while ((contactptr = AST_LIST_REMOVE_HEAD(contactlistptr,list))) {
+				ast_free(contactptr);
+			}
 		}
 	}
 
diff --git a/funcs/func_math.c b/funcs/func_math.c
index 05321b719ca3379170f8d090d2649c7e770d056c..36f3fc48a6848f32253900bee8e7d4b88e6c4175 100644
--- a/funcs/func_math.c
+++ b/funcs/func_math.c
@@ -503,6 +503,9 @@ AST_TEST_DEFINE(test_MATH_function)
 		res = AST_TEST_FAIL;
 	}
 
+	ast_free(expr);
+	ast_free(result);
+
 	return res;
 }
 #endif
diff --git a/main/editline/readline.c b/main/editline/readline.c
index adf054d633d381134c1394478430af2b30d95b26..d202adbbd8b52ce20cc592bee79a7398216c57d0 100644
--- a/main/editline/readline.c
+++ b/main/editline/readline.c
@@ -1236,8 +1236,11 @@ filename_completion_function(const char *text, int state)
 	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 @@ filename_completion_function(const char *text, int state)
 	} else
 		temp = NULL;
 	closedir(dir);
+	free(filename);
+	free(dirname);
 
 	return (temp);
 }
diff --git a/main/test.c b/main/test.c
index fdc4916e1653aa5cd71229576f94879e048697ed..94713e0e75c250bbfe6f04992b372535ff7c12eb 100644
--- a/main/test.c
+++ b/main/test.c
@@ -1053,6 +1053,7 @@ void __ast_test_suite_event_notify(const char *file, const char *func, int line,
 
 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);
diff --git a/tests/test_dlinklists.c b/tests/test_dlinklists.c
index ec13851d79049496e1002f4e084c66a28404e5af..197dd757ab72b0d84e1450fba7dd4ba608483429 100644
--- a/tests/test_dlinklists.c
+++ b/tests/test_dlinklists.c
@@ -337,6 +337,7 @@ static void dll_tests(void)
 
 		if (e == b) {
 			AST_DLLIST_REMOVE_CURRENT(list);  /* C A */
+			free(b);
 			print_list(tc, "C <=> A");
 		}
 		if (e == a) {
@@ -348,6 +349,7 @@ static void dll_tests(void)
 	AST_DLLIST_TRAVERSE_SAFE_END;
 	print_list(tc, "C <=> A <=> D");
 
+	destroy_test_container(tc);
 }
 
 static int unload_module(void)