diff --git a/tests/test_format_api.c b/tests/test_format_api.c
index dc27725a55f7d2f33f441f6a505b752091735a8c..51a6bc51177f922bf9fb65ee059d3430cfe3f503 100644
--- a/tests/test_format_api.c
+++ b/tests/test_format_api.c
@@ -299,7 +299,7 @@ static int container_test1_helper(struct ast_format_cap *cap1, struct ast_format
 {
 
 	int res = AST_TEST_PASS;
-	struct ast_format_cap *cap_joint;
+	struct ast_format_cap *cap_joint = NULL;
 	struct ast_format tmpformat;
 
 	if (ast_format_attr_reg_interface(&test_interface)) {