diff --git a/main/features.c b/main/features.c
index d7463ebc42a17a85b0110ff885ba61db27fa83f4..8f16ffa1c8d9736c219d460b3ee145e4a924398d 100644
--- a/main/features.c
+++ b/main/features.c
@@ -3012,6 +3012,9 @@ static struct ast_channel *feature_request_and_dial(struct ast_channel *caller,
 
 	tmp_cap = ast_format_cap_alloc_nolock();
 	if (!tmp_cap) {
+		if (outstate) {
+			*outstate = 0;
+		}
 		return NULL;
 	}
 	ast_best_codec(cap, &best_audio_fmt);