diff --git a/channels/chan_motif.c b/channels/chan_motif.c
index 2582a0eebe63e396157351a231aab3698737c463..0dcdf745521a0de7ac2aa0fa49def65365aeedb5 100644
--- a/channels/chan_motif.c
+++ b/channels/chan_motif.c
@@ -2759,6 +2759,8 @@ static int load_module(void)
 		ao2_ref(jingle_tech.capabilities, -1);
 		ast_log(LOG_ERROR, "Unable to read config file motif.conf. Module loaded but not running.\n");
 		aco_info_destroy(&cfg_info);
+		ast_format_cap_destroy(jingle_tech.capabilities);
+		jingle_tech.capabilities = NULL;
 		return AST_MODULE_LOAD_DECLINE;
 	}
 
@@ -2790,6 +2792,10 @@ end:
 	}
 
 	aco_info_destroy(&cfg_info);
+	ao2_global_obj_release(globals);
+
+	ast_format_cap_destroy(jingle_tech.capabilities);
+	jingle_tech.capabilities = NULL;
 
 	return AST_MODULE_LOAD_FAILURE;
 }